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.

AppGameKit Classic Chat / How can I use the "then" command?

Author
Message
kirtn14
13
Years of Service
User Offline
Joined: 8th Sep 2011
Location:
Posted: 5th Feb 2012 22:30
Im being ambitious and trying to do projects and 1 of them involves a sprite rikershaying off another and then one sprite disappearing but no matter what I do it either goes through it and no rebound or rebounds and doesnt go away so I thought could I add a "then" command so that the commands has a gap as such so it wouldn't make the sprite disapear straight away if you get me?

kirtnicholls
Funnell7
13
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 5th Feb 2012 22:34
You're using the physic commands right? Update your code and someone may be able to take a look... I may not be the best person, but I'll certainly try...
kirtn14
13
Years of Service
User Offline
Joined: 8th Sep 2011
Location:
Posted: 5th Feb 2012 22:52
I'll try make some, I deleted it all cause it kept crashing, some of it may be wrong in spelling ect sorry

Thankyou

kirtnicholls
kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 6th Feb 2012 14:18
Fixed code:




kirtn14
13
Years of Service
User Offline
Joined: 8th Sep 2011
Location:
Posted: 6th Feb 2012 16:55
doesnt help me with my problem does it though?

kirtnicholls
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 6th Feb 2012 17:07
Here (please try to be polite to people who are trying to help):


This sets a "hit" variable to 1 once a collision has occured and sets a delete timer to one second later when the sprite is 'deleted'. Any reason why you are setting its size to zero rather than just deleting it?

kirtn14
13
Years of Service
User Offline
Joined: 8th Sep 2011
Location:
Posted: 6th Feb 2012 18:00
it always crashes when i delete a sprite

kirtnicholls
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 6th Feb 2012 18:04 Edited at: 6th Feb 2012 18:06
You probably just need to make sure you check whether the sprite exists before checking for a collision:


kirtn14
13
Years of Service
User Offline
Joined: 8th Sep 2011
Location:
Posted: 6th Feb 2012 18:17
sorry it wasnt mean to be rude

kirtnicholls
Daniel TGC
Retired Moderator
17
Years of Service
User Offline
Joined: 19th Feb 2007
Location: TGC
Posted: 6th Feb 2012 20:50
IF statement then action

i.e.

a = 0
If a < 1 then a = 1

Login to post a reply

Server time is: 2024-11-23 00:58:57
Your offset time is: 2024-11-23 00:58:57