The Daily Click ::. Forums ::. Klik Coding Help ::. Creating Objects at Run-time problem with layers
 

Post Reply  Post Oekaki 
 

Posted By Message

Logiq



Registered
  09/04/2007
Points
  120
25th September, 2008 at 15:35:12 -

So I created some obstacle blocks like in the old nes megaman games. on a timer the block appears and then disappears. That works fine. I have them on two frames. On the first frame I have a background layer below my game layer that scrolls with a 0.5 coefficient and the blocks work fine. But on the second frame I did the same thing but the blocks keep getting created on the background layer. When I created the object in the code I created them relative to some invisible actives which are on the game layer. I've also made sure in the code that it is being created on the correct layer. But the problem still exist.

I hope that wasn't too confusing for you. Thanks for any help

 
Hello guys! I'm New! -- I've been new for a year now...haha

aphant



Registered
  18/05/2008
Points
  1242
25th September, 2008 at 15:47:35 -

Are you destroying the blocks then recreating them? Try making it based on animation instead, see if that works. That way the objects will always be on the designated layer and they should be able to disappear appropriately.

 

Logiq



Registered
  09/04/2007
Points
  120
25th September, 2008 at 16:01:09 -

okay i'll try that.... And it works. I don't know why I was thinking that I had to recreate them and destroy them. Thanks a lot.

Image Edited by the Author.

 
Hello guys! I'm New! -- I've been new for a year now...haha
   

Post Reply



 



Advertisement

Worth A Click