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 

No comments:

Post a Comment