ShadowCaster>
Please change back, thats not my present problem, that was my first! It was ment as a thread where I could write all my future problems, I find it unnecessary to create a new every time I will face a problem.
Well well, I have another question for you all.
I want help with adding a shop to my game. Is it easy? When you´ve killed 10 enemies, for example, you´ve earned 10 litres of blood. For that, you can buy something if you find the right place. Easy or hard to do?
I also need help with the score feature (blood). Its like, when I shoot an enemy, I earn 5 points, but if I shoot him again even after his death, I earn five more and so on... I want it to be possible only once.
I know I can do like "destroy and paste into background" but sometimes that doesn´t work and the enemy just dissapears, I dont want that.
Ok, to go into a description of how to properly use the ini to save values/strings would take a while, so here is how to do what you want with a global value...
When you shoot an enemy, and alterable value A is different than "dead value"
add 5 to blood score.
Then...
End of Level - Set global value # to blood score
Start of Level - Set blood score to global value #
Just remember to reset the global values when you start a new game, or a player could get lots of points, restart, and keep the points.
Now, when you enter a shop it sets your blood score to the global value...
If Blood score is greater or equal >= to ##
User clicks on button "buy bazooka", etc.
set weapons global value to ##
Subtract ## from blood score.
Now, just add at the start/end of every frame setting the global value to the weapons allowed, or weapons allowed to the global value.
Then add this to your firing event, depending on the value of the "weapon bought".
Firing Events
Global value(Weapon bought) = 0
---Punch---
Firing Events
Global value(Weapon bought) = 1
---Shoot---
Firing Events
Global value(Weapon bought) = 2
---Bazooka---
Firing Events
Global value(Weapon bought) = 3
---Nuke---