Three weeks ago I started working on another Mario fangame.
Here's the latest gif I took from the game.Right now I have a problem that drives me nuts,///Spiketop logic!
if (speed > 0) {
if (xscale == 1) {
//Check if there's no floor on the way.
if (place_meeting(x + lengthdir_x(speed + 1,direction - 90),y + lengthdir_y(speed + 1,direction - 90),obj_solid) == false) {
//Rotate
direction -= 90;
//Make sure it's all the way onto the next side before doing any collision checks.
x += hspeed;
y += vspeed;
//Make contact with the new surface
move_contact_object(direction - 90,speed,obj_solid);
}
//Otherwise, check if he ran into a wall.
else if (place_meeting(x + lengthdir_x(speed,direction),y + lengthdir_y(speed,direction),obj_solid)) {
//Rotate it so it's moving up the wall.
direction += 90;
//Make full contact with the wall.
move_contact_object(direction - 90,speed,obj_solid);
}
}
//Assuming that the spiny is moving left and on the ground,
else if (xscale == -1) {
//This checks *below* the spiny since you're double negating the direction... It's confusing but it works.
if (place_meeting(x - lengthdir_x(speed - 1,direction + 90),y - lengthdir_y(speed - 1,direction + 90),obj_solid) == false) {
//Rotate
direction += 90;
//Make sure it's all the way onto the next side before doing any collision checks.
x -= hspeed;
y -= vspeed;
//Make contact with the new surface
move_contact_object(direction + 90,speed,obj_solid);
}
//Otherwise, check if he ran into a wall.
else if (place_meeting(x - lengthdir_x(speed ,direction),y - lengthdir_y(speed,direction),obj_solid)) {
//Rotate it so it's moving up the wall.
direction -= 90;
//Make full contact with the wall.
move_contact_object(direction + 90,speed,obj_solid);
}
}
}
Looks cool!
Actually, the code I posted in there.
See the spiketop at the right, I want it to turn like the spiketop at the left.You just saved the day dude =3
i'm gonna play the hell out of this.
Hehe, Mario, Pokemon, FNAF and other fangames are my mortal enemies.
They steal at least 50% of my players in all indie game sites.I love the fact that you're using custom artwork for your fangame, makes it stand out quite a bit.
Here's a playable engine test of the game if you want to take a look at it.
http://gatetegaming.weebly.com/games.html