Originally posted by BOYCOTT S-T-E-A-M!:^ What they said. direction irandomrange (0,360) And finally, in your game start event put: randomize () The last two bits in Create and GameStart will make sure your enemy moves in a truly random direction at the start of the game because otherwise Game Maker will use the same random seed each time. You'd then want an alarm event for alarm 0 to have it so that once the alarm reaches 0 you set your image speed to 1 and your image index to frame 1 and to be safe set the alarm to -1 so that it knows its stopped for now. What I believe you want to happen is to check if you're at image frame 0. You then start the animation going again. ![]() Immediately after setting it to 60 you're checking if that same alarm is equal to 60, which it is since you just set to that. You're then setting alarm number 0 to the number 60. You're checking if the image is at frame 0. Might not be necessary, but try it if your animation doesn't seem to advance past frame 0.ĮDIT : Actually, looking at it again quickly your alarm itself is likely going to be an issue. Otherwise it may fall into a loop where you just sit at frame 0 all the time. You might also want to set your image_index to the next frame (frame 1) when your alarm ends in addition to setting the image_speed. ![]() Image_index is which frame the objects sprite is currently at. Like if you wanted to switch your player from "spr_idle" to "spr_walking" or whatever. ![]() Sprite_index is for changing which sprite an object is using.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |