In the description comment change the description to Set up variables.Click Add Event button in the Events box and add a Create event.If you want to setup the game to work on most desktops and laptops, on the left side, under room settings change the width to 960 and the height to 640 Code the player object to move Drag the objPlayer object into the room.This can be seen in the Room Editor’s Layers panel. Make sure you are in the Instances layer of the room.From the Assets Browser, double click room0 or whatever the default room setup is called in GameMaker.To do this click on the 3 dots in the box beside No Sprite. This code just checks if the animation is at the final frame (the frames are 0-indexed, so the 5th frame is index 4.), and if so sets the speed to 0. Assign it the sprPlayer sprite you should already have created. imageindex is the index of the current frame in the object's sprite's animation, imagespeed is the speed of the animation (in frames per step).Name the object objPlayer – note: You should always prefix your objects with the letters obj.In the Asset Browser / Resource menu area, right-click Object and click Create object. Tutorial 3: Create a player object, movement & animation
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |