Hey uhh, i have a problemI did all the code but when i go to the slopes there are 2 errorsSonic stays in the sprite he has when i stop on the slopes(for example he stays walking even if he is stand) and keeps shakingAnd also when i go slow or fast from the slope to the up solid block it stays in 45/-45 angle
i dont know if your going to do this but is there a way to put in a stopping/turning animation for sonic? i programmed sonic to look up but i don't know how to do those animations.
You explained how doing a full 360 engine would be too complicated for this tutorial. Would it be possible to sort of compromise and show a way to do things like how the Game Gear games worked? (Partially because the game I want to make is Game Gear/Mega Drive themed rather than Genesis. It seems like nobody ever takes that route.) If I remember correctly, they sort of cheated and auto-pushed Sonic through loops instead of them being physics based. All you'd have to explain would be walking up a 90 degree surface, and how to automatically path Sonic through a loop when he walked into it.
Then again, I'm the ignorant schmuck watching the tutorial to learn. I may be completely wrong in my suggestion. If so, I apologize and ask that you please disregard this comment.
ALL MY GAMES I CREATED WITH GAME MAKER IS IN MY OTHER COMPUTER THIS IS MY NEW COMPUTER.I WAS CREATING A ANDROID GAME BUT ITS NOT GETTING EXCUTABLE!!CAN YOU GIVE A TUTORIAL ON HOW TO MAKE ANDROID GAMES PLEASE!!
Hello and Thank you for this very helpfull tutos 🙂 I try lots of game maker tuto in order to build a little sonic game and this one is the best I have found. By the way, I want to learn how programming (basics) so like I said it's very helpfull.
I have found a little improvement for the orientation (scale of sonic sprite) when he is on basic obj solid, just add this and feedback me if you think it's better (sorry for my english…) :
Replace script in 'collideSlopes' script : (just add " && !place_meeting(x, y+1, objSolid) " next "ground == true "
///collideSlopes()
while place_meeting(x, y, objSlopeParent) && vspeed >= 0 { y -= 1; ground = true; }
while place_meeting(x, y+maxSpeed+1, objSlopeParent) && !place_meeting(x, y+1, objSlopeParent) && vspeed >=0 { y += 1; ground = true; }
if rolling == false && ground == true && !place_meeting(x, y+1, objSolid) { if place_meeting(x, y+1, objRSlope) drawAngle = 45; else if place_meeting(x, y+1, objLSlope) drawAngle = -45; else if place_meeting(x, y+1, objRSlopeLong) drawAngle = 23; else if place_meeting(x, y+1, objLSlopeLong) drawAngle = -23; else drawAngle = 0; } else drawAngle = 0;
is something wrong with this script? because i tried by my own .^^ If you have no idea i will try to see the project from the beginning, maybe i can find a solution for my problem ^^
nevermind i completely erased the new code to the step event and fixed the entire stopping when you get to the top of a ramp with a floor glitch with a simgle line of code
Hi! I really liked your tutorial. But Im having an issue. The issue is that when Sonic goes up the slope, he stop at the top of the slope i.e when almost on the solid floor. I followed every step of your tutorial. Help me!
Everything is working great for me so far! …Except now I don't land, when I jump I float in the air as if I'm standing on it. I don't know what happened… Could you look at my coding again? I'm sorry for bothering you. ^^;
//Movement if keyboard_check(ord('A')) && !place_meeting(x+ (abs(global.vel)*-1)-1, y, obj_ground) && (canMove == true or (rolling == true && global.vel > 0)) { global.vel -= acc * (1+ground); if global.vel > 0 && ground == false global.vel -= acc;
if rolling == false image_xscale = -1; } if keyboard_check(ord('D')) && !place_meeting(x+abs(global.vel)+1, y, obj_ground) && (canMove == true or (rolling == true && global.vel < 0)) { global.vel += acc * (1+ground); if global.vel < 0 && ground == false global.vel += acc;
if rolling == false image_xscale = 1; }
//Deacceleration if ground = true { if global.vel > 0 global.vel -= acc/(rolling+1); else if global.vel < 0 global.vel += acc/(rolling+1); } closestSolid1 = instance_place(x+abs(global.vel)+1, y, obj_ground); closestSolid2 = instance_place(x+ (abs(global.vel)*-1)-1, y, obj_ground); if (global.vel > 0 && closestSolid1 >=0) or (global.vel < 0 && closestSolid2 >= 0) { if closestSolid1 >= 0 { if closestSolid1.canWall == true global.vel = 0; } else if closestSolid2 >= 0 { if closestSolid2.canWall == true global.vel = 0; } } //Speed Limit if global.vel > maxSpeed global.vel = maxSpeed; else if global.vel < -maxSpeed global.vel = -maxSpeed;
Apparently the slopes become glitch when you place normal blocks between them or near them. For example, Sonic not being able to jump off of slopes when going too fast or too slow, and some of Sonic's animations playing incorrectly(like the spindash).
Sonic also seems to phase into the slopes if you jump on top of them.
sonic glitches alot
does it work on gms2?
Hey uhh, i have a problemI did all the code but when i go to the slopes there are 2 errorsSonic stays in the sprite he has when i stop on the slopes(for example he stays walking even if he is stand) and keeps shakingAnd also when i go slow or fast from the slope to the up solid block it stays in 45/-45 angle
Need help :/
Yay new part ! Thanks for your work 🙂
nice dude for slope dec you could make a variable slopeDec
i dont know if your going to do this but is there a way to put in a stopping/turning animation for sonic? i programmed sonic to look up but i don't know how to do those animations.
Ay Wrecking :3
Maybe you can, give me some tips.
You explained how doing a full 360 engine would be too complicated for this tutorial. Would it be possible to sort of compromise and show a way to do things like how the Game Gear games worked? (Partially because the game I want to make is Game Gear/Mega Drive themed rather than Genesis. It seems like nobody ever takes that route.) If I remember correctly, they sort of cheated and auto-pushed Sonic through loops instead of them being physics based. All you'd have to explain would be walking up a 90 degree surface, and how to automatically path Sonic through a loop when he walked into it.
Then again, I'm the ignorant schmuck watching the tutorial to learn. I may be completely wrong in my suggestion. If so, I apologize and ask that you please disregard this comment.
ALL MY GAMES I CREATED WITH GAME MAKER IS IN MY OTHER COMPUTER THIS IS MY NEW COMPUTER.I WAS CREATING A ANDROID GAME BUT ITS NOT GETTING EXCUTABLE!!CAN YOU GIVE A TUTORIAL ON HOW TO MAKE ANDROID GAMES PLEASE!!
Hello and Thank you for this very helpfull tutos 🙂
I try lots of game maker tuto in order to build a little sonic game and this one is the best I have found.
By the way, I want to learn how programming (basics) so like I said it's very helpfull.
I have found a little improvement for the orientation (scale of sonic sprite) when he is on basic obj solid, just add this and feedback me if you think it's better (sorry for my english…) :
Replace script in 'collideSlopes' script : (just add " && !place_meeting(x, y+1, objSolid) " next "ground == true "
///collideSlopes()
while place_meeting(x, y, objSlopeParent) && vspeed >= 0
{
y -= 1;
ground = true;
}
while place_meeting(x, y+maxSpeed+1, objSlopeParent) && !place_meeting(x, y+1, objSlopeParent) && vspeed >=0
{
y += 1;
ground = true;
}
if rolling == false && ground == true && !place_meeting(x, y+1, objSolid)
{
if place_meeting(x, y+1, objRSlope)
drawAngle = 45;
else if place_meeting(x, y+1, objLSlope)
drawAngle = -45;
else if place_meeting(x, y+1, objRSlopeLong)
drawAngle = 23;
else if place_meeting(x, y+1, objLSlopeLong)
drawAngle = -23;
else
drawAngle = 0;
}
else
drawAngle = 0;
after you finished these basic tutorials can you do like an extra like additional ones for 360 or other stuff
I working with game maker studio and my sonic char flies up and down on the slope. :/
while(place_meeting(x+sign(hspeed),y+1,Floor_hill) && vspeed >= 0){
y -= 1;
gravity = 0;
vspeed = 0;
jump = 0;
}
is something wrong with this script? because i tried by my own .^^
If you have no idea i will try to see the project from the beginning,
maybe i can find a solution for my problem ^^
i get the error "unknown variable closestsolid1"
nevermind i completely erased the new code to the step event and fixed the entire stopping when you get to the top of a ramp with a floor glitch with a simgle line of code
ohhhhh this is what i look for a long time.
very very thank you
I'm moving up 32 pixels! Help
Whenever there is a solid directly after/above/beside a right slope, it stops me. Any suggestions on what I may be doing wrong?
i can't go up slopes
while place_meeting(x,y,parSlope) && ysp >= 0
{
y -= 1
ground = true
}
while place_meeting(x,y+xsp + 1,parSlope) && !place_meeting(x,y+1,objSolid) && ysp >= 0
{
y += 1
ground = true
}
You can slow down Sonic on slopes with ONE LINE OF CODE! Crazy right?
1. After the code where it sets draw angle put this line in:
global.vel -= slp*sin(degtorad(angle))
2 (Optional). In the create event add:
slp = 0.125
If you don't do 2 then change step 1 to this:
global.vel -= 0.125*sin(degtorad(angle))
When I roll on the slopes, I don't roll down. Is there any way to fix that?
Hi! I really liked your tutorial. But Im having an issue. The issue is that when Sonic goes up the slope, he stop at the top of the slope i.e when almost on the solid floor. I followed every step of your tutorial. Help me!
– via YTPak(.com)
i made my sonic stand on a slope, thanks WreckingPrograms! xD#insertsplashhillzoneact1inhere
What is the best GM/GMS-made Sonic engine currently? Thanks
Everything is working great for me so far! …Except now I don't land, when I jump I float in the air as if I'm standing on it. I don't know what happened… Could you look at my coding again? I'm sorry for bothering you. ^^;
//Movement
if keyboard_check(ord('A')) && !place_meeting(x+ (abs(global.vel)*-1)-1, y, obj_ground) && (canMove == true or (rolling == true && global.vel > 0))
{
global.vel -= acc * (1+ground);
if global.vel > 0 && ground == false
global.vel -= acc;
if rolling == false
image_xscale = -1;
}
if keyboard_check(ord('D')) && !place_meeting(x+abs(global.vel)+1, y, obj_ground) && (canMove == true or (rolling == true && global.vel < 0))
{
global.vel += acc * (1+ground);
if global.vel < 0 && ground == false
global.vel += acc;
if rolling == false
image_xscale = 1;
}
//Deacceleration
if ground = true
{
if global.vel > 0
global.vel -= acc/(rolling+1);
else if global.vel < 0
global.vel += acc/(rolling+1);
}
closestSolid1 = instance_place(x+abs(global.vel)+1, y, obj_ground);
closestSolid2 = instance_place(x+ (abs(global.vel)*-1)-1, y, obj_ground);
if (global.vel > 0 && closestSolid1 >=0) or (global.vel < 0 && closestSolid2 >= 0)
{
if closestSolid1 >= 0
{
if closestSolid1.canWall == true
global.vel = 0;
}
else if closestSolid2 >= 0
{
if closestSolid2.canWall == true
global.vel = 0;
}
}
//Speed Limit
if global.vel > maxSpeed
global.vel = maxSpeed;
else if global.vel < -maxSpeed
global.vel = -maxSpeed;
if global.vel > -acc && global.vel < acc
global.vel = 0;
x += global.vel;
//Gravity
if (place_meeting(x, y+vspeed+1, obj_ground) or !place_meeting(x, y+vspeed+1, obj_SlopeParent)) && vspeed >= 0
{
ground = true;
gravity = 0;
}
else
{
ground = false;
gravity = 0.25;
if vspeed > 8
vspeed = 8;
}
//Handle Sprites
if ground == true && ducking == false && rolling == false && spindash == false
{
if global.vel == 0
sprite_index = spr_Sonic_Idle;
else if global.vel > -8 && global.vel < 8
sprite_index = spr_Sonic_Walk;
else
sprite_index = spr_Sonic_Run;
image_speed = abs(global.vel / 20)
}
else if sprite_index == spr_Sonic_Jump
{
image_speed = 0.2 + abs(global.vel / 20)
}
//Jumping
if ground == true && keyboard_check_pressed(vk_space) && ducking == false
{
vspeed = -7;
sprite_index = spr_Sonic_Jump;
}
//Ducking
if global.vel == 0 && ground == true && ducking == false && rolling == false && keyboard_check(ord('S'))
{
ducking = true;
image_index = 0;
}
//Rolling
else if global.vel != 0 && ground == true && ducking == false && rolling == false && keyboard_check(ord('S'))
{
rolling = true;
}
if ducking == true && (!keyboard_check(ord('S')) or ground == false)
{
ducking = false;
canMove = true;
}
if rolling == true && (ground = false or global.vel == 0)
{
rolling = false;
canMove = true;
}
if ducking == true && spindash == false
{
mask_index = spr_Sonic_Duck_Mask;
sprite_index = spr_Sonic_Duck;
if image_index <1
image_speed = 0.1;
else
image_speed = 0;
canMove = false;
}
else if rolling == true
{
mask_index = spr_Sonic_Spin_Mask
sprite_index = spr_Sonic_Jump;
canMove = false;
}
else if spindash == true
{
mask_index = spr_Sonic_Spin_Mask;
sprite_index = spr_Sonic_SpinDash;
image_speed = 0.25;
canMove = false;
}
else
{
mask_index = spr_Sonic_Mask;
}
//Ducking Animation in the air fix
if ground == false && sprite_index == spr_Sonic_Duck
sprite_index = spr_Sonic_Jump;
//Spin Dashing
if ground == true && ducking == true && keyboard_check_pressed(vk_space)
{
spindash = true;
if spindashTimer < 8
spindashTimer += 2;
if spindashTimer > 8
spindashTimer = 8;
spindashTimer = spindashTimer – ( ( spindashTimer ) / 256 );
sprite_index = spr_Sonic_SpinDash
image_speed = 0.3;
}
if ground == true && spindash == true && keyboard_check_released(ord('S'))
{
rolling = true;
global.vel = image_xscale * (2 + spindashTimer);
spindash = false;
spindashTimer = 0;
}
//Slope Collision
collideSlopes();
For some reason, the game keeps stopping the character frequently when going up and down slopes. If you could fix the problem, I'd be really happy.
Here's the code:
///collideSlopes()
while place_meeting(x,y,slopeparent) && vspeed >= 0
{
y -= 1;
ground = true;
}
while place_meeting(x,y+maxSpeed+1,slopeparent) && !place_meeting(x,y+1,slopeparent) && vspeed >= 0
{
y += 1;
ground = true;
}
Everything refuses to go over top the top of left slopes. Solution?
"Somehow, its still giving us an error, how lovely" I guess its lovely how the same thing is happening to me, so I'm doing it right? xD
I need help. When Sonic either spindashes or rolls into a wall with a lot of speed, he gets stuck in the wall.
I have an idea! Will you do corkscrews? or maybe corkscrews are too complicated,or maybe i already t
THANK you my love 😉
sonic just runs through the slopes for me.
he also doesn't naturally run up the slopes, but rather he slowly rises
please help
Apparently the slopes become glitch when you place normal blocks between them or near them. For example, Sonic not being able to jump off of slopes when going too fast or too slow, and some of Sonic's animations playing incorrectly(like the spindash).
Sonic also seems to phase into the slopes if you jump on top of them.
hey, how can you add momentum to slopes?
i haven't find anything about doing that.
plz help
I have the same problem as Oldum77, and I tried using that solution as well, but for some reason, it still won't work. My code:
//Movement
if keyboard_check(vk_left) && !place_meeting(x+(abs(global.vel)*-1)-1, y, obj_solid) && (canmove == true or (rolling == true && global.vel > 0)) {
global.vel -= acc * (1+ground);
if rolling == false {
image_xscale = -1;
}
}
if keyboard_check(vk_right) && !place_meeting(x+abs(global.vel)+1, y, obj_solid) && (canmove == true or (rolling == true or global.vel <0)) {
global.vel += acc * (1+ground);
if rolling == false {
image_xscale = 1;
}
}
//Deacceleration
if ground == true {
if global.vel > 0 {
global.vel -= acc/(rolling+1);
} else if global.vel < 0 {
global.vel += acc/(rolling+1);
}
}
closestsolid1 = instance_place(x+abs(global.vel)+1, y, obj_solid);
closestsolid2 = instance_place(x+(abs(global.vel)*-1)-1, y, obj_solid);
if (global.vel > 0 && closestsolid1 > 0) or (global.vel < 0 && closestsolid2 > 0) {
if closestsolid1 >= 0 {
if closestsolid1.canwall == true {
global.vel = 0;
}
} else if closestsolid2 >= 0 {
if closestsolid2.canwall == true {
global.vel = 0;
}
}
}
//Speedlimit
if global.vel > maxspeed {
global.vel = maxspeed
} else if global.vel < -maxspeed {
global.vel = -maxspeed
}
if global.vel > -acc && global.vel < acc {
global.vel = 0;
}
x += global.vel
//Gravity
if (place_meeting(x, y+vspeed+1, obj_solid) or place_meeting(x, y+vspeed+1, obj_slopeparent)) && vspeed >= 0 {
ground = true;
gravity = 0;
} else {
ground = false;
gravity = 0.25;
if vspeed > 8 {
vspeed = 8;
}
}
//Handle sprites
if ground == true && ducking == false && rolling == false && spindash == false {
if global.vel == 0 {
sprite_index = spr_sonic_idle;
} else if global.vel > -8 && global.vel < 8 {
sprite_index = spr_sonic_walk;
} else if global.vel = -8 or global.vel = 8 {
sprite_index = spr_sonic_run;
} else if global.vel = maxspeed or global.vel = -maxspeed {
sprite_index = spr_sonic_boom
}
image_speed = abs(global.vel / 20);
} else if sprite_index == spr_sonic_roll {
image_speed = 0.2 + abs(global.vel / 20);
}
//Jumping
if ground == true && (keyboard_check_pressed(vk_space)) && ducking == false {
vspeed = -7;
sprite_index = spr_sonic_roll;
}
//Ducking
if global.vel == 0 && ground == true && ducking == false && keyboard_check(vk_down) && rolling == false {
ducking = true;
image_index = 0
} else if global.vel !=0 && ground == true && ducking == false && rolling == false && keyboard_check(vk_down) { {
//Rolling
rolling = true;
}
}
if ducking == true && (!keyboard_check(vk_down) or ground == false) {
ducking = false;
canmove = true;
}
if rolling == true && (ground == false or global.vel == 0) {
rolling = false;
canmove = true;
}
if ducking == true && spindash == false {
mask_index = spr_sonic_duckmask;
sprite_index = spr_sonic_duck;
if image_index == 0 {
image_speed = 0.1
} else {
image_speed = 0;
canmove = false;
}
} else if rolling == true {
mask_index = spr_sonic_rollmask
sprite_index = spr_sonic_roll
canmove = false
} else if spindash == true {
mask_index = spr_sonic_duckmask;
sprite_index = spr_sonic_spindash;
image_speed = 0.25;
canmove = false;
} else {
mask_index = spr_sonicmask
}
//Spindash
if ground == true && ducking == true && keyboard_check_pressed(vk_space) {
spindash = true;
if spindashtimer < 8 {
spindashtimer = 8;
}
spindashtimer += 2;
spindashtimer = spindashtimer – ((spindashtimer div 25 ) / 256 )
sprite_index = spr_sonic_spindash
}
if ground == true && spindash == true && keyboard_check_released(vk_down) {
rolling = true;
global.vel = image_xscale * (2 + spindashtimer);
spindash = false;
spindashtimer = 0;
}
//Slope collision
collideslopes()
Can someone help me with Sonic walking on slopes? He shakes for some reason when he's standing/running on slopes.
Edit: fixed!!!!
HELP! my sonic can't go up slopes the long one he geters a round and the and short on he stops wen he gets to the 2 slope tile PLZ HELP!
but he can go down them