Creation and destruction of objects on the fly?

Started by Ezekiel000, Tue 09/10/2012 10:46:57

Previous topic - Next topic

Ezekiel000

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 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.

Ezekiel000

Ah right thanks, I'll try just reusing room objects.

Kweepa

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

Ezekiel000

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.

SMF spam blocked by CleanTalk