J
Joshua Hotchin
Guest
Hey guys,
So I have a shop and points feature in my game.
When the player kills enemies he gets points depending on what type of enemy!
You get ** points per level which reset if you die or leave the level.
When you move to the next level is when the points from your current level get added to your points total.
However it doesn't work!
Your points get set to 1640 and I have no clue why, I have never written that in any of the code for this game.
Drawing the points
When the player moves to the next level
If the player dies during the level
When the room starts
So I have a shop and points feature in my game.
When the player kills enemies he gets points depending on what type of enemy!
You get ** points per level which reset if you die or leave the level.
When you move to the next level is when the points from your current level get added to your points total.
However it doesn't work!
Your points get set to 1640 and I have no clue why, I have never written that in any of the code for this game.
Drawing the points
Code:
xval = 250;
if (global.points >= 1) and (room != rMenu) and (room != rControls) and (room != rUpdatesAndNotes) and (room != rShop) and (room != rEnding) and (room != rCredits)
{
DrawSetText(c_black, fMenu, fa_right, fa_top)
draw_text(xval+2,48+2,string(global.points) + string(" points"));
draw_set_colour(c_white);
draw_text(xval,48,string(global.points) + string(" points"));
}
if (global.pointsthisroom >= 1)
{
DrawSetText(c_black, fMenu, fa_right, fa_top)
draw_text(xval+2,12+2,string(global.pointsthisroom) + string(" points this level"));
draw_set_colour(c_white);
draw_text(xval,12,string(global.pointsthisroom) + string(" points this level"));
}
Code:
global.points = global.points + global.pointsthisroom
Code:
global.pointsthisroom = 0;
Code:
global.pointsthisroom = 0;