Thursday, June 15, 2017

Gamemaker Day 68

Today I learned what collision masks does, what i did : I find out that the player animation would stick into a wall sometimes, so I did a little changes in the player object. on the player object , i set the mask option to the sprite wall. this will make sure that the player pixel won't touch the wall pixel. so that whenever the player colliding with the wall, it won't stick into a wall for sure.


the next day I'm going to watch the tutorial "variable jump" , to make the jump of the player feel more real.

Tuesday, June 13, 2017

Gamemaker Day 57

Today I learned how to create an animation for the player, what i did : first I create a sprite for my running animation, I loaded 4 different image that make the player looks like running. then on the player object step event : I put "if(move !=0) image_xscale = move;" meaning if the player isn't facing the right side, it will reverse the image when the player move to the left side. and then I use "if(place_meeting(x,y+1),obj_wall)" check if the player is touching the ground. then I put "If(move! = 0) sprite_index = spr_player_run. when the player is moving , it will change the index of the sprite to the running image of the player. last i put "else sprite_index = spr_player;" if the player isn't moving , then it will change back to the normal sprite.




the next day I'm going to watch the tutorial "collision mask" , so the player will collide with the wall perfectly.

Friday, June 9, 2017

Gamemaker Day 56

Today I learned how to make the player wall jump around, what i did : I create a simple code to make the player wall jump, first I use "If (key_jump)" meaning if the player is pressing jump key , and also i use "(place_meeting(x+1,y,obj_wall) || place_meeting(x-1,y,obj_wall))"  to check if my player is colliding with the side wall, if it is then it will "vsp = -jumpseed" meaning this will make the player have the jumping speed of the side wall.


the next day I'm going to watch "animation tutorial", then i'll add an animation for the player character.

Wednesday, June 7, 2017

Gamemaker Day 55

Today I learned how to make the player has double jump. What i did : first I create the double jump variable "jumps = 0 and jumpsmax = 2" , for the jumpsmax is meaning to how many times can the player jump. and jumps is when the player hits the ground to reset the variable. then I changed something in the player object on step event. I use " if(place_meeting(x,y+1,obj_wall)" the function that i code before , it mean if player is hitting the ground then run " jumps = jumpsmax" , which will the jumps variable to 2. then I use "if (key_jump) && (jumps > 0)" to check if the jump key is being pressed and the jumps variable is above 0 also meaing the player is touching the ground, then it will run "jump -=1 and vsp = -jumpspeed". which it will reduce the jumps variable to -1. it will stop the player from jumping again.



th next day I'm going to watch the tutorial "wall jump", so that the player can jump over walls.

Tuesday, June 6, 2017

Gamemaker Day 54

Today I learned how to make my moving platform to move forward with the player, so that the player won't fall when the platform is moving. what i did: on the previous post , my player won't stay in the moving platform, even though the player is on top of the moving platform. so i did a few changes. first I use "if place_meeting(x,y-1,obj_player)" to check if the player is on the of the moving platoform. if it is then run "obj_plater.hsp_carry = hsp". This mean obj_player's hspeed to a new variable when the player is on top of the moving platform , since the "hsp_carry" is a new variable,so i have to add a numbers to it. first I set "hsp_carry" to 0 in the player object, and then I create a new variable (hsp_final) to make a composition of hspeed and hsp_carry. then I just have to change every hspeed to "hsp_final" in the horizontal collision, so that when the the player is on top of the platform, it'll have the speed of hspeed and hsp_carry.






the next day I'm going to watch the "double jump" , so that the player can have a double jump ability.

Monday, June 5, 2017

Gamemaker Day 53 May conculsion and June plan

What I learned in May: I learned a lot of new function in Gamemaker, such as how to use the function "if" more affection in the the game. then I wrapped up my shooting game project, now the shooting game is complete like a official shooting game. it has improve so much from the beginning. the next project is platform, this project has been going well so far, i learned the mistake from the previous project and now the platform are much better than the shooting game. Also I use a few function from the shooting game project apply to the platform game, so that I won't have more difficult time figuring out function.for the platform game moving object around in a room would be spending more time than figuring out a function. but overall in platform game I've been a few function: checkpoint,one way platform, enemy's collision and speed, moving platform.




checkpoint:

 one way platform:

enemy:

moving platform:


Plan on June: basically I'll finish my platform project by the end of June, there are a lot more function that i have to add into the game. also I would create another multiple room , so that the player won't stay in one room forever. this would be my last project of gamemaker.


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 .