For those that don't have the time, here is the script for the player object *create event* spd = 4; xSpeed = 0; ySpeed = 0; *step event* var xDirection = keyboard_check(ord("D")) - keyboard_check(ord("Q")); var jump = keyboard_check_pressed(vk_space); var onTheGround = place_meeting(x, y + 1, oWall); if (xDirection != 0) image_xscale = xDirection; xSpeed = xDirection * spd; ySpeed++; if (onTheGround) { if (xDirection != 0) { sprite_index = sPlayerRun_strip7; } else { sprite_index = sPlayerIdle_strip4; } if (jump) { ySpeed = -15; } } else { sprite_index = sPlayerJump; } if (place_meeting(x + xSpeed, y, oWall)) {
while (!place_meeting(x + sign(xSpeed), y, oWall)) { x += sign(xSpeed); }
xSpeed = 0; } x += xSpeed; if (place_meeting(x, y + ySpeed, oWall)) {
while (!place_meeting(x, y + sign(ySpeed), oWall)) { y += sign(ySpeed); }
one question: im having trouble identifying jump, i even copy and pasted the code from this comment but GMS says that the computer cant identify jump even though i clearly typed in what it means
You usually don't need anything more than basic arithmetic operations to make 2d games. Tons of people are making games without even knowing how to code nowadays with all of the visual scripting tools that exist so you can definitely give it a go if you're interested!
@@blobfishdev That's so inspiring to hear. I'm looking into GameStudio 2 Maker right now. You are really good at making tutorials, I'll plan on digging through more of your stuff and hopefully play some of the games soon too!
@@MicahBuzanANIMATION Thank you and good luck with your own projects! I checked out your video on Patreon tips, that was very useful advice. Got me thinking about how I could set up one and give game dev related tools, scripts and assets as rewards.
Yes please more tutorials like this. They are perfect for those of us who have limited time to learn, they really help a lot. Amazing tutorial and concept Thomas, merci beaucoup!!
Just making this comment to thank you for everything blobfish. I was able to pass my college course for games programming from this tutorial and I’ll be sure to buy your games on Steam for literally any way to show thanks to such an incredible god tier gamemaker legend
For those that had trouble moving left to right, I had the same thing. What I had to fix was when I copied the code in the step function while(!place_meeting(x+sign(xSpeed),y,oWall)) { x+=sign(xSpeed); } I pasted it and replaced all the x's with y's. I missed one of the x's, once I changed it to y the code worked.
Hi mate, I am currently making my own platformer for a school project, your video here is an awesomely quick and a great way to learn this stuff in a hurry. Thank you for that.
5:10 when I press the 'alt' button to draw in the tiles with the wall object, the whole platform moves, and it doesn't draw anything. How can i fix this?
Weird, you should just have to highlight the oWall object in the Asset browser and it should even display a message at the bottom f the room next to the x,y coordinates that says "LMB + ALT to paint with selected object resources". (just above the "output" tab) Once highlighted if you press ALT (without letting go) the wall object should appear at the position of your mouse. If it doesn't work for some reason you can always just drag and drop the oWall object into the room directly or copy/paste it and move it after.
Thanks a lot, almost done with a year game design class and I have to do my own game as the final. This tutorial taught me so much since really the only thing they taught was making card and pinball type games
I'm learning Gamemaker by making a Mario clone now. Figuring out how to make the character move and collide is really confusing. But you explain it so well and concisely that it is easy to understand. Thank you for making this video.
I have some problems with this line: var xDirection = keyboard_check(ord("D")) - keyboard_check(ord("Q")); when i start test, it makes sprite more slim Help pls
i was looking for a tutorial which was easy to modify and allowed me to add movement options like ground pounds and dashes easily and this DEFINITELY is doing the trick for me, especially with the new camera code and the very basic movement code
Do you know How to change the character's speed with this code? For some reason my character walks WAY to slow and even because of this the jump is almost static, maybe is a sprite problem because I'm using other sprite, could It be?
I think the very last thing you missed is how you close the game itself. Like pressing esc to close game when it's in fullscreen. But overall this whole tutorial have been more helpful then most others out there that span through hours of videos. Thank you!
Im having a Issue. My character can't move left or right at all, but his animation does play. He only moves to either sides when I jump and press either A or D.
Hard to say what's wrong without seeing the code but maybe you put the x += xSpeed line in the else statement after the if (onTheGround) statement so the speed doesn't change when the player is on the ground. Try to see if the xSpeed value updates correctly when you're on the ground and pressing A or D (use show_debug_message(xSpeed))
@@blobfishdev Ok, here is the code. In my code xSpeed is hsp, while ySpeed is vsp. var xDirection = keyboard_check(ord("D")) - keyboard_check(ord("A")); var jump = keyboard_check_pressed(vk_space); var onTheGround = place_meeting(x, y + 1, obj_tile); if (xDirection != 0) image_xscale = xDirection; hsp = xDirection * walk_spd; vsp++; if (onTheGround) { if (xDirection != 0) { sprite_index = spr_potatorun; } else { sprite_index = spr_potato; } if (jump) { vsp = -15; } } else { sprite_index = spr_potatojump; } if (place_meeting(x + hsp, y, obj_tile)) {
while (!place_meeting(x + sign(hsp), y, obj_tile)) { x += sign(hsp); }
hsp = 0; } x += hsp; if (place_meeting(x, y + vsp, obj_tile)) {
while (!place_meeting(x, y + sign(vsp), obj_tile)) { y += sign(vsp); }
@@gobro3900 I don't see anything wrong in that code, maybe something to do with the collision box of the player and the tile object, or when you're spawning him he gets stuck in the tile or something like that
at 6:30 i input the code perfectly correct, yet when i try to run the game it says "Object: oPlayer Event: Step at line 6 : malformed statement" and im super confused pls help
Thank you! Good tutorial. 13 minutes but took me like 2 hours XD Edit: It's been two days. Still can't figure out what's wrong with the collision. @4:24 It's not clear for me how to set the collision as oObjects fall infinitely.
if you changed the room size and the camera isnt working try putting the camera in the middle of the room i found having it where the camera's border is already outside of the room makes it bug out
my dumb character keeps falling through the floor everytime i try starting the game, and also my coins are surrounded by a white wall that won't go away. help me please.
You really make the code seem less confusing then other tutorials I've followed! Have you considered putting together a GML platformer engine for sale on YoYo and Itch? 90% of them are outdated (GM 1.4) and the new ones that are there seem overly complicated.
I've thought about it but wasn't sure if it would be worth my time to put something like this together since it seemed to me like there were already alternatives (haven't looked much into it though). Last few weeks I've been playing around with Godot so still not sure which engine I'll use moving forward but might look into it if I choose to continue with GameMaker
@@blobfishdev Yeah I really couldn't say if it would be worth the effort. But what I will say is that the ones that are out there for sale are either very old (made for GM1.4) or have a lot of features that kind of get in the way of having a clean, easy-to-understand platformer engine that you can re-skin and build upon.
Thanks for this awesome tutorial. I'm having an issue (hopefully I'll figure it out quickly) where the sprite is leaving a trail when it moves around. Not sure why, yet.
Probably something to do with the background of your room, I think it does this when it's empty. Have you tried putting an image or a color as the background?
@@blobfishdev I am having a similar issue. if I press D to go right and then press Q to change direction, it does this thing where it skips and kinds teleports left a few tiles and then goes left. i have already tried your solution and it did not work
@@nathandalley9650 I think it might be because the origin of your sprite is not exactly at the center so when you flip it it won't be in the same position
i am having a issue, where it is saying the oWall variable is unassigned, where in the tutorial i think it doesn't metion about assigning the variable oWall to something. Please help me.
That was a great content! can someone help if something? how to separate "falling" to "jumping", to make the player able to jump is he just falls from some place?
I'd probably use tile collision directly instead, it's a bit more complicated though (but not that much). This video explains it: ua-cam.com/video/UyKdQQ3UR_0/v-deo.html
You probally don't even see those comment anymore but I have a problem, for some reason my character moves SUPER slow, and I can't Really point out where I can change his speed with this code, what do I do?
Make sure: -That you have placed the oWalls objects where the tiles are (only having the tiles won't work) @5:12 -In the oPlayer step event that you're checking collision with the oWall objects @7:30
Ca peut venir de plusieurs choses. J'ai épinglé un commentaire qui reprend le script du joueur, copie colle le ou assure toi que tu as bien écris les mêmes choses dans le même ordre
Hey, pls reply... i have an issue. i dont know how to create a animation strip like when you sprint. when i just draw a bunch of pictures it just shows the intire image
In your sprite, click on "Edit Image", then the "Image" menu tab at the top and "Convert to frames" and set the right numbers / size then "Convert". If you add _stripX at the end of the name of your file before importing it where X is the number of frames GameMaker does that for you automatically. It only works for horizontal spritesheets
Didn't realize for quite a bit that your using Gamemaker Studio 2 and not Visual Studios, which is what I am using. Is Gamemaker Studio 2 good for making games such as this one?
Very good tutorial. Helped me understand things a looot better than many others I've found. How well would this code work with angles/straight slopes? The platforming is planned to be more of a way of moving around the game world than the game in and of itself, (it's a JRPG that uses a sidescrolling view) so I don't need super precise collision, I think.
Hi, I'm having an issue. I can't get my character to jump, I've looked over the code and compared it to what you wrote and can't find anything wrong. I use my space key and it doesn't do anything. A second issue, when my character walks off of a platform, he get's stuck in the air in the jump animation frame for a full second to second and a half before instantly falling to the closest ground. Thanks for your time, I appreciate the tutorial. oPlayer Step event code: var xDirection = keyboard_check(ord("D")) - keyboard_check(ord("A")); var jump = keyboard_check_pressed(vk_space); var onTheGround = place_meeting(x, y + 1, oWall); if (xDirection != 0) image_xscale = xDirection; xSpeed = xDirection * spd; ySpeed++; if (onTheGround) { if (xDirection != 0) { sprite_index = sPlayerRun_strip7; } else { sprite_index = sPlayerIdle_strip4; } if (jump) { ySpeed = -15; } } else { sprite_index = sPlayerJump; } if (place_meeting(x + xSpeed, y, oWall)) {
while (!place_meeting(x + sign(xSpeed), y, oWall)) { x += sign(xSpeed); }
xSpeed = 0; } x += xSpeed; if (place_meeting(x, y + ySpeed, oWall)) {
while (!place_meeting(x, y + sign(ySpeed), oWall)) { y += sign(ySpeed); }
@@blobfishdev It makes the screen smaller, but it is still just a black screen. I am curious how to fix this because this video has been a massive help :)
Why does this line: var onTheGround = place_meeting(x, y + 1, oWall); work with "y + 1" and not something like "y + sprite_height / 2"? I would have expected it to measure off of the sprite's origin, not its bottom edge.
Actually I think I just figured it out. It isn't checking whether a point is colliding with the given object, but whether the entire original object is colliding with the given object, if it were moved to the given x and y
I am currently trying this this tutorial on Gamemaker 1.4,. For some reason, the character runs really slow on the obj wall but really fast on air, is there anyway I can fix this?
Might make a tutorial later when I get the time but it'll probably be a while until then, you should be able to find something on UA-cam in the meantime though. Basically add a new check for a key press or mouse click in the player Step event and play an attack animation when that happens and spawn a bullet with some speed
Maybe you wrote something like: x = xSpeed instead of: x += xSpeed or the same thing with y and ySpeed Its hard to tell but you can check the pinned comment with the code and see if there's any difference with yours
@@blobfishdev also can you upload a tutorial about adding melee attacks with a sword or something like that? Pls it would be helpful. Anyway keep up the great work!
Make sure you got these lines correct in the Step event of the oPlayer object, this should make you go to the left (A) or to the right (D) depending on which key you're pressing: var xDirection = keyboard_check(ord("D")) - keyboard_check(ord("A")); if (xDirection != 0) image_xscale = xDirection; xSpeed = xDirection * spd;
Because you need to calculate the position of the camera on two axis: horizontal which is x and vertical which is y. Here we need to use the x position of the player to set the x position of the camera and the y position of the player to set the y position of the camera.
You could use another variable (timesJumped or something) to track the number of jumps the player has done which gets reset when they hit the ground and only allow them to jump if they're on the ground or if timesJumped is below 2 (and ofc increase it by 1 whenever they jump)
Hi, nice tutorial. Maybe i'm being stupid but i can't get the thing up where you can write your won code. Is that because i have a later version of GMS? I can only do a search instead of type code like you do.
For those that don't have the time, here is the script for the player object
*create event*
spd = 4;
xSpeed = 0;
ySpeed = 0;
*step event*
var xDirection = keyboard_check(ord("D")) - keyboard_check(ord("Q"));
var jump = keyboard_check_pressed(vk_space);
var onTheGround = place_meeting(x, y + 1, oWall);
if (xDirection != 0) image_xscale = xDirection;
xSpeed = xDirection * spd;
ySpeed++;
if (onTheGround) {
if (xDirection != 0) { sprite_index = sPlayerRun_strip7; }
else { sprite_index = sPlayerIdle_strip4; }
if (jump) {
ySpeed = -15;
}
} else {
sprite_index = sPlayerJump;
}
if (place_meeting(x + xSpeed, y, oWall)) {
while (!place_meeting(x + sign(xSpeed), y, oWall)) {
x += sign(xSpeed);
}
xSpeed = 0;
}
x += xSpeed;
if (place_meeting(x, y + ySpeed, oWall)) {
while (!place_meeting(x, y + sign(ySpeed), oWall)) {
y += sign(ySpeed);
}
ySpeed = 0;
}
y += ySpeed;
Thanks!
one question: im having trouble identifying jump, i even copy and pasted the code from this comment but GMS says that the computer cant identify jump even though i clearly typed in what it means
@@matrixpictures7799 what does the error code look like
@@growdot1961 here: cannot set a constant ("jump") to a value
Hippity hoppity your code is now my property
'We have basically recreated flappy bird.'
And that right there gets a like. The effectiveness of this tutorial gets a fav.
This video inspires me to give game making a try. I always thought it would be beyond me because I'm bad at math, but this gives me hope.
You usually don't need anything more than basic arithmetic operations to make 2d games. Tons of people are making games without even knowing how to code nowadays with all of the visual scripting tools that exist so you can definitely give it a go if you're interested!
@@blobfishdev That's so inspiring to hear. I'm looking into GameStudio 2 Maker right now. You are really good at making tutorials, I'll plan on digging through more of your stuff and hopefully play some of the games soon too!
@@MicahBuzanANIMATION Thank you and good luck with your own projects! I checked out your video on Patreon tips, that was very useful advice. Got me thinking about how I could set up one and give game dev related tools, scripts and assets as rewards.
@@blobfishdev Help, i use my own sprites and I'm on 6:17 time. Why does my character sprite just keep falling.
Nvm i just didnt press space, but..... i cant seem to go left with my controls
I love the style of the egg character, it reminds me of the binding of issac!
greg the egg
greg
@@cynicaldweller4925 greg
Yes please more tutorials like this. They are perfect for those of us who have limited time to learn, they really help a lot. Amazing tutorial and concept Thomas, merci beaucoup!!
I was thinking of doing this. I would need a Wacom.
Just making this comment to thank you for everything blobfish. I was able to pass my college course for games programming from this tutorial and I’ll be sure to buy your games on Steam for literally any way to show thanks to such an incredible god tier gamemaker legend
Haha awesome!
For those that had trouble moving left to right, I had the same thing. What I had to fix was when I copied the code in the step function
while(!place_meeting(x+sign(xSpeed),y,oWall))
{
x+=sign(xSpeed);
}
I pasted it and replaced all the x's with y's. I missed one of the x's, once I changed it to y the code worked.
Hi mate, I am currently making my own platformer for a school project, your video here is an awesomely quick and a great way to learn this stuff in a hurry. Thank you for that.
Very good and quick tutorial. Most people on YT need hours to explain all of this.
5:10 when I press the 'alt' button to draw in the tiles with the wall object, the whole platform moves, and it doesn't draw anything. How can i fix this?
Weird, you should just have to highlight the oWall object in the Asset browser and it should even display a message at the bottom f the room next to the x,y coordinates that says "LMB + ALT to paint with selected object resources". (just above the "output" tab)
Once highlighted if you press ALT (without letting go) the wall object should appear at the position of your mouse. If it doesn't work for some reason you can always just drag and drop the oWall object into the room directly or copy/paste it and move it after.
@@blobfishdev Thank you!! It works now! ^^
Thanks a lot, almost done with a year game design class and I have to do my own game as the final. This tutorial taught me so much since really the only thing they taught was making card and pinball type games
I'm learning Gamemaker by making a Mario clone now. Figuring out how to make the character move and collide is really confusing. But you explain it so well and concisely that it is easy to understand. Thank you for making this video.
I have some problems with this line:
var xDirection = keyboard_check(ord("D")) - keyboard_check(ord("Q"));
when i start test, it makes sprite more slim
Help pls
Came from Reddit, thank you so much!
thank you! i was having alot of trouble with other videos on the topic
came from reddit, already know some of these things but your tutorial are really superb!
+1 sub
5:11 it doesn't work, when i try to hold the left alt button it just moves the camera and the right alt button does nothing. so what do i do?
ngl i've used this tutorial at least 5 times :D. really really great, helping me achieve my gamedev dream!
Is there another method for 5:23? my alt button is not working on game maker for some reason
With this knowledge, I shall finally make a platformer
this video helped me a bunch, thanks!
Woah this is 100% gonna be the building blocks for something im planning
All tutorials should be like this. I am new to gamemaker and I am happy to find a video that's straight to the point. Thanks
minus the anoying ass fucking jumpcuts that video makers LOOOOVE to put in their videos, then yes
loved the content, it really helped
i was looking for a tutorial which was easy to modify and allowed me to add movement options like ground pounds and dashes easily and this DEFINITELY is doing the trick for me, especially with the new camera code and the very basic movement code
Do you know How to change the character's speed with this code? For some reason my character walks WAY to slow and even because of this the jump is almost static, maybe is a sprite problem because I'm using other sprite, could It be?
the intro already deserves a like and a sub
Best Tutorial for UA-cam for Platformer game
I think the very last thing you missed is how you close the game itself. Like pressing esc to close game when it's in fullscreen. But overall this whole tutorial have been more helpful then most others out there that span through hours of videos. Thank you!
bro just you saved my A grade in computer game making 💀 but srsly tysm for this tutorial I don't know what I would have done without it
Im having a Issue. My character can't move left or right at all, but his animation does play. He only moves to either sides when I jump and press either A or D.
Hard to say what's wrong without seeing the code but maybe you put the x += xSpeed line in the else statement after the if (onTheGround) statement so the speed doesn't change when the player is on the ground. Try to see if the xSpeed value updates correctly when you're on the ground and pressing A or D (use show_debug_message(xSpeed))
@@blobfishdev Ok, here is the code. In my code xSpeed is hsp, while ySpeed is vsp.
var xDirection = keyboard_check(ord("D")) - keyboard_check(ord("A"));
var jump = keyboard_check_pressed(vk_space);
var onTheGround = place_meeting(x, y + 1, obj_tile);
if (xDirection != 0) image_xscale = xDirection;
hsp = xDirection * walk_spd;
vsp++;
if (onTheGround) {
if (xDirection != 0) { sprite_index = spr_potatorun; }
else { sprite_index = spr_potato; }
if (jump) {
vsp = -15;
}
} else {
sprite_index = spr_potatojump;
}
if (place_meeting(x + hsp, y, obj_tile)) {
while (!place_meeting(x + sign(hsp), y, obj_tile)) {
x += sign(hsp);
}
hsp = 0;
}
x += hsp;
if (place_meeting(x, y + vsp, obj_tile)) {
while (!place_meeting(x, y + sign(vsp), obj_tile)) {
y += sign(vsp);
}
vsp = 0;
}
y += vsp;
@@gobro3900 I don't see anything wrong in that code, maybe something to do with the collision box of the player and the tile object, or when you're spawning him he gets stuck in the tile or something like that
Amazing tutorial, you simplifed the whoel rpocess compared to what teh defualt templates are. thank you.
This is the most helpful tutorial I've seen in months. thank you
J'admire la patience des codeurs surtout en indé parce que tout faire tout seul franchement chapeau
C'est clair que c'est pas toujours simple !
This inspired me to learn drawing so that I can make the cute character animation.
at 6:30 i input the code perfectly correct, yet when i try to run the game it says "Object: oPlayer Event: Step at line 6 : malformed statement" and im super confused pls help
Is there a way to change the gravity in the step event?
OMG THANK YOUUUUUUUUUUUUUUUUUUUUUUUUUUU AFTER A THOUSAND OF VIDEOS I FOUND THE EAISIST AND FASTEST CODE EVER, AMAZING TYYYYYYYYYYYYY
00:22 How did you get to Import??
Thank you! Good tutorial. 13 minutes but took me like 2 hours XD
Edit: It's been two days. Still can't figure out what's wrong with the collision. @4:24 It's not clear for me how to set the collision as oObjects fall infinitely.
What do you mean by "oObjects fall infinitely"? The walls shouldn't be moving and in the oPlayer object you check for collision with them.
@@blobfishdev sorry oPlayer Wow coding is hard.
if you changed the room size and the camera isnt working try putting the camera in the middle of the room i found having it where the camera's border is already outside of the room makes it bug out
Bon tutorial, merci mon gars
hey can u add enemys in the game to make it more fun?
my dumb character keeps falling through the floor everytime i try starting the game, and also my coins are surrounded by a white wall that won't go away. help me please.
Make it xspeed = 0 in the player code and also y speed=0
hey, can I have some help? when I get close to the tiles, they stretch and get all weird.
You really make the code seem less confusing then other tutorials I've followed! Have you considered putting together a GML platformer engine for sale on YoYo and Itch? 90% of them are outdated (GM 1.4) and the new ones that are there seem overly complicated.
I've thought about it but wasn't sure if it would be worth my time to put something like this together since it seemed to me like there were already alternatives (haven't looked much into it though). Last few weeks I've been playing around with Godot so still not sure which engine I'll use moving forward but might look into it if I choose to continue with GameMaker
@@blobfishdev Yeah I really couldn't say if it would be worth the effort. But what I will say is that the ones that are out there for sale are either very old (made for GM1.4) or have a lot of features that kind of get in the way of having a clean, easy-to-understand platformer engine that you can re-skin and build upon.
salut, je n'arrive pas a importé les assets sur game maker, des conseils ?
when my character changes direction, it teleports it forward a bit, it only does this when changing direction, How do i fix this?
This is so good! Just one question, how do I create those non-pixel sprites?
I drew them in Krita with a graphical tablet
@@blobfishdev imagine someone drawing it on a computer...
Thanks for this awesome tutorial. I'm having an issue (hopefully I'll figure it out quickly) where the sprite is leaving a trail when it moves around. Not sure why, yet.
Probably something to do with the background of your room, I think it does this when it's empty. Have you tried putting an image or a color as the background?
@@blobfishdev Thanks! I don’t know how I overlooked that. Haha
@@blobfishdev
I am having a similar issue. if I press D to go right and then press Q to change direction, it does this thing where it skips and kinds teleports left a few tiles and then goes left. i have already tried your solution and it did not work
@@nathandalley9650 I think it might be because the origin of your sprite is not exactly at the center so when you flip it it won't be in the same position
So i have just renamed my sWall im curently in the room about to draw them but when i press alt nothing happens :(
i am having a issue, where it is saying the oWall variable is unassigned, where in the tutorial i think it doesn't metion about assigning the variable oWall to something. Please help me.
That was a great content!
can someone help if something?
how to separate "falling" to "jumping", to make the player able to jump is he just falls from some place?
3:16 i have problem i cant it dont make code it make drag and drop variables
use gamerlanguage
Great tutorial! Many thanks!
im trying to make a sandbox game so what do i do at 5:15?
I'd probably use tile collision directly instead, it's a bit more complicated though (but not that much). This video explains it: ua-cam.com/video/UyKdQQ3UR_0/v-deo.html
when i make a new project which one should i chose drag and drop or gamemaker language ??
If you want to follow this tutorial you should choose GameMaker Language.
@@blobfishdev thx bro
Somehow my character can't move left and right, but it can jump and can jump according to the direction. Is there any thing I missed?
You probally don't even see those comment anymore but I have a problem, for some reason my character moves SUPER slow, and I can't Really point out where I can change his speed with this code, what do I do?
does it not work for studio 1.4? character is getting stuck in the floor but can move fine left and right in air.
The style reminds me of An Untitled Story quite much
Also a bit reminds me of Wuppo
Quite nice
My player falls through the platorms, i dont know how to fix it as i am new. any idea why?
Make sure:
-That you have placed the oWalls objects where the tiles are (only having the tiles won't work) @5:12
-In the oPlayer step event that you're checking collision with the oWall objects @7:30
Il y a une petit probleme ! Je puet pas marcher gauche et droite . Quand j appuie A ou D jusque l 'animation commence
Ca peut venir de plusieurs choses. J'ai épinglé un commentaire qui reprend le script du joueur, copie colle le ou assure toi que tu as bien écris les mêmes choses dans le même ordre
@@blobfishdev Merci , Je copier coller et tout c'est bien
Hey, pls reply... i have an issue. i dont know how to create a animation strip like when you sprint. when i just draw a bunch of pictures it just shows the intire image
In your sprite, click on "Edit Image", then the "Image" menu tab at the top and "Convert to frames" and set the right numbers / size then "Convert".
If you add _stripX at the end of the name of your file before importing it where X is the number of frames GameMaker does that for you automatically. It only works for horizontal spritesheets
Hey man,i have a problem,my collision from oWall only works on top of the sprite,like the x axis for the collision doesn t work
Didn't realize for quite a bit that your using Gamemaker Studio 2 and not Visual Studios, which is what I am using. Is Gamemaker Studio 2 good for making games such as this one?
when i press left and right the sprite is offset
help, im new to this
I finshed all the coding and ran the game but My character is not moving its saying in the same place , I need help.
When I try to put walls object by holding Alt its putting a question mark and I cant place the thing correctly anyone knows how to fix this ?
Very good tutorial. Helped me understand things a looot better than many others I've found. How well would this code work with angles/straight slopes? The platforming is planned to be more of a way of moving around the game world than the game in and of itself, (it's a JRPG that uses a sidescrolling view) so I don't need super precise collision, I think.
i love how when he says "oWall" it sounds like "owo"
Hi, I'm having an issue. I can't get my character to jump, I've looked over the code and compared it to what you wrote and can't find anything wrong. I use my space key and it doesn't do anything. A second issue, when my character walks off of a platform, he get's stuck in the air in the jump animation frame for a full second to second and a half before instantly falling to the closest ground. Thanks for your time, I appreciate the tutorial.
oPlayer Step event code:
var xDirection = keyboard_check(ord("D")) - keyboard_check(ord("A"));
var jump = keyboard_check_pressed(vk_space);
var onTheGround = place_meeting(x, y + 1, oWall);
if (xDirection != 0) image_xscale = xDirection;
xSpeed = xDirection * spd;
ySpeed++;
if (onTheGround) {
if (xDirection != 0) { sprite_index = sPlayerRun_strip7; }
else { sprite_index = sPlayerIdle_strip4; }
if (jump) {
ySpeed = -15;
}
} else {
sprite_index = sPlayerJump;
}
if (place_meeting(x + xSpeed, y, oWall)) {
while (!place_meeting(x + sign(xSpeed), y, oWall)) {
x += sign(xSpeed);
}
xSpeed = 0;
}
x += xSpeed;
if (place_meeting(x, y + ySpeed, oWall)) {
while (!place_meeting(x, y + sign(ySpeed), oWall)) {
y += sign(ySpeed);
}
ySpeed = 0;
}
hey i'm having an issue at the player action part because I can't type in any of the code
When I try and run the game my screen goes completely black and nothing happens. Do you know what may be causing this?
What if you remove the window_set_fullscreen(true) line in the oCamera create event?
@@blobfishdev It makes the screen smaller, but it is still just a black screen. I am curious how to fix this because this video has been a massive help :)
@@TheShnizNite That's weird, maybe something to do with your version of GameMaker? This tutorial was done in 2.3
@@blobfishdev I am using the 30 day free trial version, but it is 2.3
Very odd. I wonder what the problem may be
Why does this line:
var onTheGround = place_meeting(x, y + 1, oWall);
work with "y + 1" and not something like "y + sprite_height / 2"? I would have expected it to measure off of the sprite's origin, not its bottom edge.
Actually I think I just figured it out. It isn't checking whether a point is colliding with the given object, but whether the entire original object is colliding with the given object, if it were moved to the given x and y
@@ZachDurtschi Yep you got it
cam u make a video where you put enemies in or put a health bar
I am currently trying this this tutorial on Gamemaker 1.4,. For some reason, the character runs really slow on the obj wall but really fast on air, is there anyway I can fix this?
I've never used GM 1.4 sorry, probably something todo with the collisions where the character is clipping into the wall
do you have anything for adding in shooting mechanics like in a mega man game?
Might make a tutorial later when I get the time but it'll probably be a while until then, you should be able to find something on UA-cam in the meantime though. Basically add a new check for a key press or mouse click in the player Step event and play an attack animation when that happens and spawn a bullet with some speed
godly egg video
do you actually choose to press Q to move left in games??
I have a problem thomas! Pls help
Whenever i try to move the player it just falls out of the room.. how do i fix this?
(Pls reply)
Maybe you wrote something like:
x = xSpeed
instead of:
x += xSpeed
or the same thing with y and ySpeed
Its hard to tell but you can check the pinned comment with the code and see if there's any difference with yours
@@blobfishdev sure! Btw thanks for replying! :)
@@blobfishdev also can you upload a tutorial about adding melee attacks with a sword or something like that? Pls it would be helpful. Anyway keep up the great work!
when i use alt lmb it doesnt do anything?
what can i do to fix it
how do you open a game make project????
When i start running, my character just flies away like a plane
thanks for the good tutorial, i have not money now for support you, but i subscribe and sell a like (for the free assets)
nice work!
idk WHY but I tryied EVERYTHING perfectly but it STILL wont play
I just cannot get my assets to be non-pixelated in GMS2. It bugs me so much.
i love this video
i followed everything you said in the video, but the character doesn't move to the left. it only jumps and moves to the right.
Make sure you got these lines correct in the Step event of the oPlayer object, this should make you go to the left (A) or to the right (D) depending on which key you're pressing:
var xDirection = keyboard_check(ord("D")) - keyboard_check(ord("A"));
if (xDirection != 0) image_xscale = xDirection;
xSpeed = xDirection * spd;
@@blobfishdev That worked! Thanks
helped a lot ty
Why do you put “.x” after the oPlayer at 8:48
Because you need to calculate the position of the camera on two axis: horizontal which is x and vertical which is y. Here we need to use the x position of the player to set the x position of the camera and the y position of the player to set the y position of the camera.
@@blobfishdev thanks that makes a lil more sense. Also, i bought your game lost potato on steam before i even found your channel lol
how would i go about adding a double jump?
You could use another variable (timesJumped or something) to track the number of jumps the player has done which gets reset when they hit the ground and only allow them to jump if they're on the ground or if timesJumped is below 2 (and ofc increase it by 1 whenever they jump)
Can you make this but with visual gml?
man thank you a lot
This is a wonderful lesson. But when my character moves, its size becomes original and not the one I set in the editor( What i can do?
Hi, nice tutorial. Maybe i'm being stupid but i can't get the thing up where you can write your won code. Is that because i have a later version of GMS? I can only do a search instead of type code like you do.
oh man i just found it hahaha
why my movement when changes direction it like dash?
You’re sprite origin is probably set wrong, should be middle centre / between the legs, etc…
best tutorial on youtube
Do you have to do animations yourself or does the program do it for you
You have to make them
@@blobfishdev ok
I followed through the steps and a lot of parts I got stuck and could not fix what happened so I stopped
same
Stuck where?
My character isn´t moving to the left, what could I have done wrong