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 / sprite sometimes showing sometimes not

Author
Message
Shonne
7
Years of Service
User Offline
Joined: 24th Jun 2016
Location:
Posted: 28th Jun 2016 09:10
why is it that sometimes the sprite shows up and sometimes the sprite does not show. i don't think the problem are the images because if the image is the problem. AppGameKit would display the default error image.

JLMoondog
Moderator
15
Years of Service
User Offline
Joined: 18th Jan 2009
Location: Paradox
Posted: 28th Jun 2016 09:23
What are you trying to do? :/ I expect if you ran the debugger you'll get a never ending string of errors. You're currently trying to create a sprite every loop using an existing sprite created the very first loop.....no no no no Get that thing outside the main loop.
My workstation was destroyed in a fire, help me out and get free media for AppGameKit and Game Guru: https://www.gofundme.com/bfpm0g
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 28th Jun 2016 15:34
Apart from the points by JLMoondog (I would have shouted the same much louder in CAPS, red and bold flashing), what do you mean by "sometimes the sprite does not show"?
It is extremely possible that you are using the same image twice in succession, and you are overlaying them one on top of the other. They are all also at the same depth, so the order is somewhat unpredictable (could be image number or image loading order, I can't remember which). And at 60 FPS, I don't know how you spotted that they are sometimes missing!

You also only need 5 images. Use SetSpriteColor() to change the colour of your shape images as you make a sprite from them.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
JLMoondog
Moderator
15
Years of Service
User Offline
Joined: 18th Jan 2009
Location: Paradox
Posted: 28th Jun 2016 21:09 Edited at: 28th Jun 2016 21:18
Shonne sent me the actual codez, I guess this was the 'basics' of the original to try and detect the problem. Just some advice, if you have a bug popping up in your game/app, post all the codez, not just a dumb-down version of it, or you'll make it 100x harder to actually track down the bug.

The real codez:


Just with a quick glance I can see a ton of issues :/ Give me a bit and I'll come up with a quick example of the way I would go about doing this..unless someone beats me to the punch.

Edit: Just to clarify, so your game/app goes as follows(?):
1) show three shapes on screen
2) ask player to select a specific colored shape
3) correctly selecting shape = win
4) incorrectly selecting shape = loose
5)reset game
My workstation was destroyed in a fire, help me out and get free media for AppGameKit and Game Guru: https://www.gofundme.com/bfpm0g
Shonne
7
Years of Service
User Offline
Joined: 24th Jun 2016
Location:
Posted: 29th Jun 2016 03:13
yes the game goes like that

Login to post a reply

Server time is: 2024-04-24 18:15:37
Your offset time is: 2024-04-24 18:15:37