Not sure how to properly get variables to cycle

Show us your works in progress and request feedback

Post » Fri Mar 24, 2017 2:24 am

Message: jadden14 can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
I made a game were weapons cycle based on the gunswitch variable within GUN_A. I have it set to go from 0 to 2 and upon reaching to it resets to 0. For some unknown reason it reaches 2 then drops to 1 and continues to cycle from 1 and 2. The text also seems to get confuzed and sets the text defined for gunswitch 1 fto 0 and the gunswitch 2 text to 2.

here is my .capx if needed
http://www.mediafire.com/file/6fw98ezcaljpj88/kekgame.capx
image of the problem that i cant seem to find
Image
B
4
Posts: 4
Reputation: 208

Post » Fri Mar 24, 2017 4:35 am

GUN_A=(GUN_A+1)%3
Image Image Image
B
43
S
22
G
15
Posts: 383
Reputation: 12,262

Post » Fri Mar 24, 2017 1:23 pm

thank you good sir, so what was the problem? because from what it looked like i was just setting gunswitch to different values, but this seems to work much smoother?
B
4
Posts: 4
Reputation: 208

Post » Sun Mar 26, 2017 8:54 am

@jadden14 i didn't check your solution but GUN_A=(GUN_A+1)%3 is a way to cycle positive from 0 to %X-1
hope i could help youy
Image Image Image
B
43
S
22
G
15
Posts: 383
Reputation: 12,262


Return to Works in Progress/Feedback Requests

Who is online

Users browsing this forum: No registered users and 3 guests