Game Mechanics Game Maker 7.0 Problems

T

Thomas West

Guest
I've started making this arcade game in where you shoot asteroids to rake up points, but in my latest project, I added a energy system. Basically, if you use a special weapon, or you are hit by an asteroid, you loose power, aka health. I wanted to add an energy pickup, where it restores some health. But, (BTW, this is made on Game Maker 7.0 for windows Vista) when I set the collision event variable action to 'max(damage-25)', instead of adding 25 heath points when the ship parent object collides with it, it takes away health.
Any way of helping me out on this?
 
O

onishounen

Guest
So, I can't be sure what your code does without more that just one statement, but from what I can tell, there are a few things wrong here.
1.) If you want to include the function max(), you need to include a list of variables and/or fixed numbers separated by commas. What max() does is it picks the highest number out of your list so max(7,3,1,9,0) would return 9.
2.) If you are wanting to increase your energy variable by 25, you would want to do something like this: energy = energy + 25. You can read the previous statement like this "Set energy equal to what energy is now plus 25."
3.) I think there is a different subforum for programming questions, but you may in time learn what the difference is. For now, hopefully these answers will help :)
 

Yal

šŸ§ *penguin noises*
GMC Elder
GM interprets the - symbol as a minus sign and first computes damage minus 25, then uses the maximal value... and there's only one value to choose from; the result of the subtraction. Use a comma instead.
 
D

Drewster

Guest
I've started making this arcade game in where you shoot asteroids to rake up points, but in my latest project, I added a energy system. Basically, if you use a special weapon, or you are hit by an asteroid, you loose power, aka health. I wanted to add an energy pickup, where it restores some health. But, (BTW, this is made on Game Maker 7.0 for windows Vista) when I set the collision event variable action to 'max(damage-25)', instead of adding 25 heath points when the ship parent object collides with it, it takes away health.
Any way of helping me out on this?
Looks like a couple already gave you useful suggestions -- I assume they worked?

Also, I'd really recommend you update to GMS from GM 7.0. It really is better in almost every way. After a few speed bumps as you get used to it, you'll be happy with the added features.
 
T

Thomas West

Guest
Looks like a couple already gave you useful suggestions -- I assume they worked?

Also, I'd really recommend you update to GMS from GM 7.0. It really is better in almost every way. After a few speed bumps as you get used to it, you'll be happy with the added features.
I have GMS, but all my GM files are on the computer with GM 7.
 
Top