Author Topic: Creation and destruction of objects on the fly?  (Read 272 times)  Share 

I was wondering how the marbles part of Kweepa's Mega Demo was done?

http://www.kweepa.com/step/ags/games/MegaDemo.zip (5Mb)

I'm trying to create a mini game where objects randomly fall from the top of the screen and the player has to move the character to catch the objects.

Crimson Wizard

  • AGS Project Admins
  • not et suppotreD
    • I can help with translating
    •  
Re: Creation and destruction of objects on the fly?
« Reply #1 on: 09 Oct 2012, 11:06 »
AGS does not allow to create/delete object dynamically other than DynamicSprite and DrawingSurface.
Haven't seen Kweepa's script, but those things are usually done either by reusing a limited number of graphical objects (like GUI buttons, Room Objects or  Characters for instance), or storing objects data (coordinates) in your own arrays and drawing them manually on screen.

Re: Creation and destruction of objects on the fly?
« Reply #2 on: 09 Oct 2012, 22:34 »
Ah right thanks, I'll try just reusing room objects.

Kweepa

  • Mutated Guano Deviser
    • Best Innovation Award Winner 2009, for his modules and plugins
    •  
  • Kweepa worked on a game that was nominated for an AGS Award!
Re: Creation and destruction of objects on the fly?
« Reply #3 on: 10 Oct 2012, 00:48 »
I just used a large array, and RawDraw.
The source code for the demo is here:
http://www.kweepa.com/step/ags/tech/megademosrc.zip

Depending on how many objects you want to have, this might be a better approach than room objects.
Still waiting for Purity of the Surf II

Re: Creation and destruction of objects on the fly?
« Reply #4 on: 10 Oct 2012, 08:35 »
Thank you, I'll do a few tests to see which way I want to go.
Even if I reuse room objects it is always interesting to learn and understand new techniques.