Skip to main content

Posts

L 10

graphically tweaked the gamemaker 2 game, working on making things like mountains and land/water borders dynamic(they change their appearance depending on what is around them)
Recent posts

L 9

continued with the gamemaker 2 project, setting up a decent algorithm for creating land near the center of the room.

L 8

got a pretty decent algorithm for creating land, but haven't been able to add any form of consistency. randomize() if genstage = 0 { while (cposx < room_width && cposy < room_height) { failure = distance_to_point(centerx,centery); success = distance_to_object(obj_land) chance = (irandom_range(0,failure)); if(chance < 50) { instance_create_depth(cposx,cposy,0,obj_land); cposx += 64; show_debug_message(failure); show_debug_message(success); show_debug_message(chance); } else { instance_create_depth(cposx,cposy,0,obj_ocean); cposx += 64; } if (cposx == room_width && cposy != room_height) { cposy += 64; cposx = 0; } else { genstage = 2; } } } here is a photo of the finished product

L 7

began integrating some of the loops i learned into gml(game maker language). started working on a random terrain generator. /// create event // Initializing variables cposx = 1; cposy = 1; // Creating step event   | /// world generation if genstage = 0 {// creates a worldwide ocean while (cposx < room_width && cposy < room_height) { instance_create_depth(cposx,cposy,0,obj_ocean); cposx += 1; if (cposx == room_width && cposy != room_height) { cposy += 1; cposx = 1; } else { genstage = 1; } } }

L 6

this lesson i continued work on changing strings this code displays different ways to write the same thing. var = "a string" print ("the above variable is", str(var) + "... {}".format(var))

L 5

today i am doing some further work with editing strings. in this code i reformat a badly written sentence. start = "        THis is_BadlY wriTt#N_______" print(start) print(start.replace("_"," ").replace("#","E").rstrip().lstrip().lower().capitalize() + ".") in this code i work on printing out only selected pieces of a string. var = "6 six 7 seven 8" six = var[0] print("six is", six + " or", var[2:5] + ", not", var[1::5])

L 4

This lesson i am working on functions in python. below is a simple game with the two functions, walk(), and attack(). walking will trigger a 1/2 chance to spawn an enemy. import random hp = 5 atk = 1 enemy = False enemyhp = 3 enemyatk = 1 encounter = random.choice([0,1]) def attack():     global enemy     global hp     global atk     global enemyhp     global enemyatk     if enemyhp <= 1:         enemy == False         print("You have destroyed the enemy.")     else:         if enemy == True:             hp -= enemyatk             enemyhp -= atk             print("your health is {} and enemy health is {}".format(hp,enemyhp))         else:             print("you attack but there is nothing th...