How to work variables

R

Rosepike

Guest
Hello, I'm currently working on a university project and have been advised to use variables to achieve the goals I want for my project.

However, the problem is that I don't know how to set them up or how to work them.

For my game, I want my character to possess certain abilities when he attacks an enemy with a special attack.
When he does this, I want the character to change sprite into the enemy where he will then gain abilities from the enemy.

Up to now I have done the following;
global.Meele= 0;
global.double_jump= 0;
global.scientist= 0;
global.Electricity: 0;

How do I set what happens to each variable when they are true?


I hope this makes sense. I am new to the software so I apologize if none of this makes sense.
Thank you :)
 

zendraw

Member
everything below 0.5=false
0.5+ anything above=true

you can simply change them betwean 0 or 1
or -1/1
so when a change happens do this
global.melee=-global.melee
 
R

Rosepike

Guest
everything below 0.5=false
0.5+ anything above=true

you can simply change them betwean 0 or 1
or -1/1
so when a change happens do this
global.melee=-global.melee
How do i set what happens in each variable? Do i do this in script or in the player object?
 
Top