E
Elric
Guest
Hi, I'm currently learning GameMaker Studio by working on an Asteroids clone (from Shaun Spalding's tutorial). I have pretty much finished the game, and am now adding my own mechanics to further get accustomed to GameMaker and GML.
I'm trying to add the ability to gain lives through achieving a certain score. Basically, adding a new life every time the player scores x-amount of points. I've only begun recently and am still learning the syntax and different functions, so please bear with me.
I've tried this, however, nothing happened.
I also tried this code:
The second piece of code actually gave a response, but not the desired one. Instead of the desired effect, it just continuously added an unending amount of lives for each frame after the player achieved over 1000 points.
Any ideas? Am I even using the proper function? Should I be using something other than the "if" function?
I appreciate any help that can be given. Thank you!
I'm trying to add the ability to gain lives through achieving a certain score. Basically, adding a new life every time the player scores x-amount of points. I've only begun recently and am still learning the syntax and different functions, so please bear with me.
I've tried this, however, nothing happened.
Code:
if (global.points = global.points + 1000)
{
global.life = global.life +1
}
Code:
if (global.points > 1000)
{
global.life = global.life + 1
}
Any ideas? Am I even using the proper function? Should I be using something other than the "if" function?
I appreciate any help that can be given. Thank you!