![]() This, combined with a bit of randomness to the x & y coordinates of the object, helps the slash effect look a little different each time. We could include more or less angles in the choose function here, but this works pretty well. The slashEffect_obj’s Create Event then picks an angle using “image_angle = choose(90, 180, 270, 360)”. This is so the slash object is not always created in the exact center of the enemy object. Note the x and y positions–we’re adding a random number from -4 to 4 to x and to y. If not, go ahead and set it for 1/10th of a second, play a sound, and call instance_create_depth to create the slashEffect_obj. ![]() ![]() When my enemy parent object gets hit (all enemies are children of this object, so any enemy that gets hit basically), first check to see if a hit alarm has already been set. A quick and easy way to do a sword-slash effect in GameMaker!
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |