Wednesday, May 31, 2017

Gamemaker Day 52

Today I learned how to make a moving platform. what i did : I mostly use the code that i had on enemy to apply on the moving platform , because the enemy's movement and the platform movement are very similar coding.  first I duplicate the wall sprite and recolor it, and then copy the create event code on the enemy object into my platform moving object. so that they can have the same variable.
then I copy the step event on the enemy object into my platform moving object , so that the platform would move the same as the enemy , when the moving platform hit the wall , it will goes opposite way. but i haven't finish the moving platform yet, the platform still needs more improvement.mainly today I remove everything in the room , to make it more difficult to play with.




the next day I'm going to continue watching the tutorial , and do more improvement for the moving platform.

Tuesday, May 30, 2017

Gamemaker Day 51

Today I learned how to make my player can jump through the walls, what i did : first I load a sprite for the platform wall, and set y to 0 , so that the player would land on top of the sprite , and not in the middle of it. then I use "parent" to make the platform wall has the same effect as the normal wall.then I create variable that make the wall has no sprite on the create event, then I make a draw event to draw the sprite out but it has no function on the sprite , it was only the sprite on the game. on the step event, I use " if (instance_exists(obj_player))" meaning if the player exists then run the code down below, this make sure of the player is in the game in order to active the code. then if the player exists, then i use "(if(round(obj_player.sprite_height/2)) > y)" which to check if my player is below the platform wall, if it is then "mask_index = spr_platform" to make the platform wall sprite to no sprite , expect the y-int.








the next day I'm going watch the tutorial "moving platform", to make a moving platform in my game

Monday, May 29, 2017

Gamemaker Day 50

Today I learned how to make the checkpoint work. what i did: First I create a variable in the create event, "if(global.checkpointR == room)" which mean if the checkpoint is red, then x=global.checkpointx; and y = global.check.point. next thing I did is I change something in the enemy collision code. in the else function instead of using room_restart. I wrote a script for the player's death, because there will be many way that the player can die, so if I write a script for it , I wont have to create new function everytime. on the script, I use "if(global.checkpoint !=0)" which mean if the player died by colliding with the enemy, then it will turn the checkpoint color back to black and restart the game.





 The next day I'm going to watch the tutorial "one way wall", to make a wall that the player can go through.



Friday, May 26, 2017

Gamemaker Day 49

Today I learned how to make a check point for my game, but I haven't finish the checkpoint yet. it doesn't do anything for now. what i did : first I create a sprite for my checkpoint outlook, then I colorize it into two color : black and red. and I set "image_speed and image_index" to 0. on the step event I wrote "image_angle +=1", so it made the checkpoint looks more cooler. then I create a new room for the initialize code, basically is to set the variable to global.so that every object can access to this variable. I use "if (global.checkpointR ==room)" to check if the checkpoint is in the room. and i use "if(place_meeting(x,y,obj_player))" to check if the player colliding with the checkpoint. if so then it will change the image_index to 1 , which it will turn red.









the next day I'm going to finish off the checkpoint , so my player would actually goes back to the point

Thursday, May 25, 2017

Gamemaker Day 48

Today I learned how to make the enemy won't fall if they walk on the ledges. what i did: first I create a variable as usual, then I continue coding on the vertical collision section of the enemy. I used "!position_meeting" to check if the enemy is on the ledges of the wall , if the enemy  is on the ledges then it would run "dir* = -1" which mean going the opposite direction. the next thing I do is create a new object, because I don't want every enemy of my game has no fall function. so I duplicate the enemy object and parent it to the main enemy object, so that i can adjust a new version of the enemy.
then I use "Call the inherited event to prevent the main enemy object to overwrite the no fall enemy.








the next day i'm going to create a "checkpoint" in my game 

Wednesday, May 24, 2017

Gamemaker Day 47

Today I learned how to make the game restart when the player collided with the enemy. what i did: I add a piece of code into the collision event, if the player is colliding with the enemy , then the game will restart. I use " if(place_meeting(x,y,obj_player)" to tell gamemaker that if the enemy is colliding with my enemy, then run "if(obj_player.y < 0)" to say my player is colliding with the enemy at any part of the enemy. If so it will restart the game.

The next day I'm going to watch the tutorial and learn "Enemies and Ledges"

Tuesday, May 23, 2017

Gamemaker Day 46

Today I learned how to make the enemies bounce back if they hit a wall, it will get destroy. What i did : first i create some variable for the enemies, then I set hsp and vsp = 0. so that i can add up the hsp and vsp later on the step event. I basically use the same the code that I wrote on the previous day. so that the enemies won't get stuck the wall or fell out of the map, but I added one line of code that make my enemies bounce back if they hit the wall. I use "dir*=-1" this mean if goes the opposites direction of what my enemies was going. also I found a sprites for my enemies object , then I resize it again.






tomorrow I'm going to do the collision of the enemies and the player , and watch the tutorial to learn it "enemies"

Friday, May 19, 2017

Gamemaker Day 45

Today I learned how to use make my player move faster when it touch the power up object. what i did: first I recolor my player to red for speed sprite, then I loaded a new sprite for my power up in movespeed. I use a similar function as the previous day, I change jumpspeed to movespeed. and I create a new variable for movespeed while its power up, and I input a new sprite when the player touch the power up object.then in the player object I added a line "movespeed = movespeed_noraml" which mean after the power up , it will return to the normal speed. also I added more wall and object in the room.










the next day I'm going to watch the tutorial "enemies" and add enemies into the game.

Thursday, May 18, 2017

Gamemaker Day 44

Today I learned how to change a player jumping speed of a period of time,and I learned a few function, also make the player turn into a different color. What i did : first I use some sprite on the internet , then I use gamemaker inbuilt customize color to make my player blue , I paint the player part of it blue , but not the whole character. in the coding , I had to change jumpspeed to jumpspeed_normal , so that It will be more clear of what change in the value . but if i change the name of it , I'll have to change every code in every object. so I use a simple code to fix it : jumspeed = jumpspeed_normal. now gamemaker read jumpspeed is equal to jumpspeed_normal , so i dont have to change it in every code line. and today I use the function "alarm" . in gamemaker alarm represent time , this will run other code for a period of time, then when the time ran out , it will change it back to the normal jumpspeed.











the next day I'm going to change the "power up" function to a speed up function , which is instead of making my player jumping higher , I would make the player move faster .


Wednesday, May 17, 2017

Gamemaker Day 43

Today I learned how to fixed a bug on my game , in previous post I found a problem that whenever my character ran into a wall , it will get stuck . and also I learned a few function in GML. what i did : I use "place_meeting()" function to check the the wall is in front of the player, then I use the "while" function , which it mean carry on the coding. I also use "sign" function to limit the number of hspeed and vspeed. in "sign" if the speed is over 1 or -1 , it will return to 1 or -1 . so I use these function to fix my problem of the game .





The next day I'm going to next tutorial of platform "power up" , and then add more function in there.

Monday, May 15, 2017

Gamemaker Day 42

Today I learned a new function call "place_meeting();" this function is to check for a collision, if the object is collide with other object ,then it will change off the position of it . what i did : the first thing i did is create some variable for my character, and then I did the basic movement of the character, the character only can move left and right for now . when the player press "space" , then the player will move 7 pixel up. when the player move right or left , it will have 4 pixel speed. also I use "place_meeting" to check if my character colliding with the wall, if it is then my vertical speed will set to 0, but it the player isn't colliding with the wall , then it will move down.





the next day I'm going to continue watching the the tutorial then add more thing to it

Thursday, May 11, 2017

Gamemaker Day 41

Today I started with a new platform game project, what i did : I added some sprite into my game so far, the player and wall sprite had been added into the first room. the original image size aren't the size that I want it into the game ,so I have to use stretch to resize the image , so that I can fit the image into the game, I haven't done any coding yet for objects.  but I found some tutorial online that could guide me through out making the game. the first tutorial video is Platform Tutorial . For now I'll follow along the tutorial .




The next day I'm going to watch the tutorial and add more stuff to my game.

Wednesday, May 10, 2017

Gamemaker Day 40

Today I wrapped up my shooting project, for now I'm finished my shooting project. I started with a simple basic movement game , and turn into a shooting game with a lot of function on it. my shooting game contain 3 different level. to make a game doesn't just use coding function , also I have to research about animation or make an animation character for myself through out making this game. I learned quite a lot GML. There are some error that I can't figure it out , even if I watch all the tutorial or reading article online, but I do a better job on my next project. My shooting project has a few big section : menu , player, enemy, score , animation and all the other stuff.

level1;

level2:

level3:




The next day I'm going to move on to platform game project .

Tuesday, May 9, 2017

Gamemaker Day 39

Today I learned how to make a ending for my game and changing the enemy's speed in different room and create a spot for my levelmenu to go back to main menu. What i did : I change the enemy's speed by using step event, and then I use "if(room == level2)" to run whatever code in level2 of the enemy object. then I change speed to 1 in room 2 and speed 1.5 in room 3. to make the game more difficult in different level. the next thing I did is the ending screen , I use " If(!instance_exits(obj_enemy))" to create a text when all enemy is destroy, when all enemy is destroy then draw "winner" on the screen, then I change a bit in the levelmenu script , I added a line for going back to the main menu , I put room_goto(rm_menu) on the script, which means whenever I press the line , it will go back to the main menu.












The next day I'm going to improve anything in my shooting project.