A
Artwark
Guest
Ok so I used this for a switch statement
What its suppose to do is that when global.points gives a value from 10 onwards, objects need to increase their speed from that point on. Problem is that the objects only do it when it reaches 10 and after it comes to 11, they go back to their normal speed. I want them to increase their speed from that point on.
I can easily fix this through if statement but I want to use switch since the objects will only increase their speed further when global.points reaches a certain value. Is there a way to do this using switch statement?
Code:
switch(global.points)
{
case(10): speed = 2; break;//if global.points is == 10, speed increases by 2
case(30): speed = 4; break;//if global.points is == 30, speed increases by 4
case(50): speed = 6; break;//if global.points is == 50, speed increases by 6
}
I can easily fix this through if statement but I want to use switch since the objects will only increase their speed further when global.points reaches a certain value. Is there a way to do this using switch statement?