Page 1 of 1

How to minimize events for mutiple charaters

PostPosted: Wed Aug 21, 2013 7:09 pm
by phxdragon
Ok Im not sure if the title is descriptive enough and was having trouble searching in the forum for something similar.

Basically I have a working character selection for a platformer with three characters, maybe more latter on. I wanted to minimize the number of events for using up memory or space for each charters.

So i made one general sprite and set of control events for that; plus separate sprites for each charter for simplicity.

How do i switch those characters objects in and out of the general sprite to work with the control event so i don't have to make the same event for each character?

Tried variable switching but couldn't figure that out. I can spawn another object by variables and delete the general sprite but that probably wont work with the general control event.

Would an array work? i don't know.

Thanks in advance for any insight.


Re: How to minimize events for mutiple charaters

PostPosted: Thu Aug 22, 2013 11:25 am
by plinkie
Add the characters into a Family called Characters. Then you can trigger events that apply to every character.

Re: How to minimize events for mutiple charaters

PostPosted: Thu Aug 22, 2013 11:24 pm
by philx
set the different characters as animation frames of only 1 sprite. create the events for the character sprite and choose the appropriate animation frame for the chosen character.

Re: How to minimize events for mutiple charaters

PostPosted: Sun Sep 08, 2013 2:29 am
by phxdragon
Thanks guys.


Re: How to minimize events for mutiple charaters

PostPosted: Sun Sep 08, 2013 10:40 pm
by jojoe
You can also use the Function plugin for things that all of the bots will share too.

If everyone shoots bullets, you can have the bullet setup all in 1 function "shootBullet". Rather than having the action blocks for the "add bullet sprite", "add muzzle flash sprite", "reduce nearest bot ammo -1","PLay bullet shoot sound", "alert friendly player bots to gunshot location"...

You can see it adds up really quick.

I put off learning the function plugin until recently. I wish I would have read about it first, it would have saved me a lot of time debugging all my copypasta.
jojoe2013-09-08 22:41:26

Re: How to minimize events for mutiple charaters

PostPosted: Sun Sep 08, 2013 11:13 pm
by Sargas
also, when copying the events for one player to the next, the "replace object" options really comes in handy!