The Daily Click ::. Forums ::. Klik Coding Help ::. Destroy and create objects without making them flash
 

Post Reply  Post Oekaki 
 

Posted By Message

Hernan



Registered
  04/03/2003
Points
  707

VIP Member
10th November, 2006 at 13:50:32 -

Hi, i have a problem with objects flashing when creating objects right before they are destroyed. It's really annoying me.

Ok, so it's like this: I have a number of objects lined up. When a certain events happen (for example, i press space) i want to destroy all objects (i sorta want to 'reset' them) and immediately create them so it doesn't look like anything happened (in my game something does happen of course, but that's not the point here).

I did this:
*some event => start loop "reset" 10 times

*on loop "reset"
+loopindex < 9 => destroy objects

*on loop "reset"
+loopindex = 9 => start loop "create"

*on loop "create" => create the objects

Now why the hell won't this work? The objects are destroyed and and created in one loop (and subloop) and they still flash. Anyone know a solution or is this another crappy MMF bug?



 
This space is for rent

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
10th November, 2006 at 14:13:04 -

You could try reordering your events like this:

* some event
- start loop "reset" 10 times
- start loop "create" 10 times

* on loop "reset"
- destroy objects

* on loop "create"
- create the objects

That should work pretty much the same, because it will run the entire "reset" loop before continuing with the "create" loop and the rest of the events. Just mess around with the event order or something.

 
n/a

Hernan



Registered
  04/03/2003
Points
  707

VIP Member
10th November, 2006 at 14:22:00 -

Nope, doesn't work either.

 
This space is for rent

Pixelthief

Dedicated klik scientist

Registered
  02/01/2002
Points
  3419

Game of the Week WinnerWeekly Picture Me This Winner!You've Been Circy'd!VIP MemberI like Aliens!Evil klikerThe SpinsterI donated an open source project
10th November, 2006 at 15:16:45 -

Are you sure its the original objects flashing and not the first frame of the newly created objects? New objects like to have a single frame of their stopped or appearing animation at direction 0 flash on the screen when they are created, just because events kick in after they are created the way MMF and TGF is structured, even if those events are to immediately destroy the object or make it invisible; if thats the case, you can create the objects OFFSCREEN, then set them to the x/y coordinates you want, or something like that.

Even this would probably have a 1 Frame of the object turning invisible, ie flashing.
Your best bet would be having a slight overlap; if its possible, recreate the new objects, THEN delete the old objects in the next frame. You'll either have 1 frame where you have twice as many objects, which could be buggy depending on what your program does, or if you code it right, they should never overlap, but have no *flash*

 
Gridquest V2.00 is out!!
http://www.create-games.com/download.asp?id=7456

Hernan



Registered
  04/03/2003
Points
  707

VIP Member
10th November, 2006 at 15:16:55 -

die plz

 
This space is for rent
   

Post Reply



 



Advertisement

Worth A Click