Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / Why isn't my sprite animation working corectly?

Author
Message
Rafaelinio
10
Years of Service
User Offline
Joined: 27th May 2013
Location:
Posted: 24th Dec 2016 11:55
Sorry if my code is terrible, first time i try to use AGK:


So, the loops at the start set each frame to the sprite. I attached the pictures in this thread if you guys need them(They are terrible, i just quickly made them with photoshop to try making this app :p )
Inside the main loop, i think its pretty self explanatory. If the button is pressed, play the specific animation needed.

My problem is, it always comes out to Heads for some reason. What am i doing wrong?
Sorry for the noob question :p
Trololololo

Attachments

Login to view attachments
damothegreat
User Banned
Posted: 26th Dec 2016 12:34
Is your radomisation not working correctly

My best bet is probably put a Print statement in each of the IF statements, to see where the logic keeps heading towards

I.E



then if the code always plays the same PRINT SPRITE <num> then its a logic error in the IF statements, if it plays all 4 depending on the random
on each loop then it maybe the implementation of the sprite animation issue

Let us know once you got debugging in place and come back to us

Damian

Using Tier 1 AppGameKit V2
Started coding with AMOS
Anything is possible if put mind to it
damothegreat
User Banned
Posted: 26th Dec 2016 12:57 Edited at: 26th Dec 2016 13:38
Just reliased you popped your PNGs here, I have had a look

Try this:-



Your code was just flipping in SECT 1 and 3.

So I made the State_Coin flip too in each step, so now it will flip inside all 4 IF statements

Damo
Using Tier 1 AppGameKit V2
Started coding with AMOS
Anything is possible if put mind to it
Rafaelinio
10
Years of Service
User Offline
Joined: 27th May 2013
Location:
Posted: 26th Dec 2016 14:05
Ah alright, i get what i did wrong, thanks for the help!
Trololololo
Rafaelinio
10
Years of Service
User Offline
Joined: 27th May 2013
Location:
Posted: 26th Dec 2016 14:20
Ok i realised i had some other issues in there with the frames used and some variables not being correctly assigned :p Fixed those too and its working perfectly, thanks
Trololololo

Login to post a reply

Server time is: 2024-03-29 14:03:35
Your offset time is: 2024-03-29 14:03:35