![]() Then left click once on oWall to highlight it. In GMS2 select the “Instances layer” on the left and click and drag oPlayer from your resource tree into the world. Go to your room (One is created for you by default in GMS2) by double clicking on it in the resource tree. Lots of stuff right? Don’t worry about it. While (!place_meeting(x,y+onepixel,oWall)) Var onepixel = sign(vsp) //up = -1, down = 1. Check for vertical collisions and then move if we can While (!place_meeting(x+onepixel,y,oWall)) Var onepixel = sign(hsp) //moving left or right? right = 1, left = -1. Check for horizontal collisions and then move if we can If (place_meeting(x,y+1,oWall)) and (key_jump) Copy & paste the following code: //Get inputs (1 = pressed, 0 = not pressed) ![]() If not in gms2 add the code action again as needed. If not in GMS2: Find and add the “Execute a piece of code” action and drag it into the actions window, then double click it to get to the code editor.Īdd the following code exactly as written: grv = 0.2 //gravity.In oPlayer, click “Add Event” and find the “Create” event.Again, right click in resource tree, this time on objects.Close any sprite/image windows still open.Make them both solid colour boxes (important.) Call one sWall, and the other sPlayer.Right click on sprites in the resource tree and select “Add sprite”.Name the room whatever you like if you want to. In the settings tab that will appear, set “Speed” from 30 to 60. In other versions, create a new room by right clicking on “rooms” in the resource tree and selecting “Create room”.Make sure you click on “Apply” afterwards. In GMS2, go to game settings (Cog symbol) -> Main options -> General and set “Game frames per second” to 60.This first step isn’t too important but the numbers we use are based on it.Make a Platformer in GameMaker Make a platformer in GameMaker (any version)Ī micro tutorial by Start by making a new project (GML project if GMS2).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |