piratenanax.blogg.se

Game maker studio 2 platformer tutorial
Game maker studio 2 platformer tutorial





game maker studio 2 platformer tutorial

#GAME MAKER STUDIO 2 PLATFORMER TUTORIAL CODE#

A lot of the time, this code would just continue to play the current animation. Then you would some code for the player that is run every frame. Which animation is currently playing, and how much of the animation has played Are they standing still, walking, or turning aroundģ. Which way is the player currently facingĢ. You will need to play these animations or their mirror images depending on the state of the player, see below:ġ. A turning around animation eg, turning from left to right. A walking animation that walks a single step.ģ. This might only be a single frame (so actually just an image, not an animation)Ģ. But remember, for a cinematic platformer, this also involves a turning around and standing still. Then, the character will be unresponsive again until they finish the next animation, and then at that time they will again check what keys are being pressed.įor instance, you might start by programming a player character who can only walk left and right. Generally, the state will change when an animation finishes playing, and the state it changes to next will depend on what keys are being pressed at that time. State is what your player character is doing right now, and will dictate which animation is shown. So, the most important thing to program is the "state". The user can learn that pressing jump from standing still jumps two squares, and a running jump is three squares. The player would have variables for x velocity and y velocity, and you modify them every frame based on gravity, controls pressed, ground friction or air friction, etc.īut back to cinematic platformers: until they fall of a cliff, the player hardly has any "physics", because they always do every move the same way. When programming your player, it think it will be important to start by programming what "state" they are in.Īs a contrast, if you were programming Super Mario Bros (eg ) you might start by programming your player's "physics", which are very simple approximations of real physics. I have never written a cinematic platformer, but I do work full-time as a programmer and I have played those cinematic platformers a lot, so I thought I'd have a try at answering. Thank you for reading, and here's to hoping this account proves useful in the future, because at the moment I've only made it to talk about this. I don't know, if either of these ideas sound viable enough, let me know, but I just think it be interesting to talk about, since I can literally find no information on the subject anywhere else on the internet. I can see this working better with hit detection as well, but it would also mean precisely setting every single sprite's size, which might take to long given the time window I have. My other idea might be easier in that respect, that being I'd have different sprites for each type of movement, and when that sprite animation finishes, set the object's location to where it should be. However, I'm not sure how I'd get it to only register input at one of the specified grid locations, at least not without a lot of testing. This would be more in line with how I traditionally program a platformer. My first idea would be to set the player's speed depending on the input, then set it back to zero when the reach the appropriate grid location.

game maker studio 2 platformer tutorial

Obviously, there'd be some kind of grid that the player's location would be set to. I have two ideas as to how I'd go about it, but they both seem like they'd be unnecessarily tricky to work with. I was hoping I could discuss it here with somebody before diving into it. For reference, I'll be doing this in Game Maker Studio 2, since I'm very familiar with GML. But to be honest, I'm not exactly sure where to start with the logic or system that the game would require. If I can at least get a proof of concept or prototype done, I'll be happy. Over the rest of winter break I'm hoping to create a cinematic platformer in the style of Abe's Oddysee or Another World/Out of this World, in order to practice writing, design, art, and programming in one project.







Game maker studio 2 platformer tutorial