B
BenSunhoof
Guest
Hello. It's been a while.
I'm trying to make something simple - an auto-scrolling flying game where you click to gradually ascend. I've implemented almost everything I wanted, except for the score system.
1 point is assigned each 6 frames, making up 10 points per second. Here's what I'm trying to do - bonus points should be assigned whenever the player comes close to the edge of the obstacle. Here's the code I tried (a separate piece of code in the Step event of obj_score that affects obj_wall):
Instead of doing what I want it to do, the game adds 50 points whenever the player passes by a wall, I suppose its 25 points for both the bottom and the top sections of the wall, and it adds these points regardless of whether I'm near the obstacle or not.
What can I do here? Please help.
I'm trying to make something simple - an auto-scrolling flying game where you click to gradually ascend. I've implemented almost everything I wanted, except for the score system.
1 point is assigned each 6 frames, making up 10 points per second. Here's what I'm trying to do - bonus points should be assigned whenever the player comes close to the edge of the obstacle. Here's the code I tried (a separate piece of code in the Step event of obj_score that affects obj_wall):
GML:
//Bonus score
if obj_player.x = x
{
if (bbox_top > obj_player.bbox_bottom > bbox_top-obj_player.bbox_top) | (bbox_bottom < obj_player.bbox_top < bbox_bottom+obj_player.bbox_bottom)
score += 25;
}
What can I do here? Please help.