[SOLVED] I Need Help With A Character Select Screen

Mattcus

  • Posts: 24
Hello Stencylers!

In my game i want to have that at the beginning of each level you get to choose which character you would like to use. Once you click the characters icon then a full body picture appears in the middle of the screen and a name and description appears at the top, then you hit a play button at the bottom to start the level. I am fairly new to Stencyl so if someone would be able to help me with how to do this that would be much appreciated. If you could include pictures that would help even more

(EDIT) I kinda changed my mind with the way i want this to work. Instead of clicking on the icon you just hover you mouse over it then the body and text appear and when you click the icon you start the level as that character.

« Last Edit: November 03, 2011, 11:10:19 pm by Mattcus »

Alexin

  • *
  • Posts: 3127
The basic idea:

1) Create a scene for the Character Select screen.

2) Within the Scene Designer, place the icons of the various characters.

3) Create an Actor behavior to attach to the icon actors. This behavior should tell the scene to show the full body when the icon is clicked.

4) Create a Scene behavior and attach it to the scene. This behavior listens for messages sent the behavior above and changes the the body and description.

5) Place an actor for the play button. Attach a behavior that switches scenes when it's clicked.
"Find the fun"
alexin@stencyl.com

Mattcus

  • Posts: 24
Thanks i'll give it a go now and see if it works.

Mattcus

  • Posts: 24
I kinda changed my mind with the way i want this to work. Instead of clicking on the icon you just hover you mouse over it then the body and text appear and when you click the icon you start the level as that character. This is what i have so far with showing the full body image but when you hover over it the image is created (Which is good) But it doesn't go away when the mouse leave the icon. Please help.

Ps. The coin is just a placeholder

rob1221

  • *
  • Posts: 9473
I'm guessing the coin doesn't go away because your game freezes from spamming actors onto the screen every frame.  When using the always block you want to make sure things that should not actually happen in every frame aren't by controlling them with boolean attributes.  Example attached.

Mattcus

  • Posts: 24
Thanks but that doesn't seem to work all it did was make me able to select created when modifying the behaviour. Maybe i did something wrong?

« Last Edit: November 02, 2011, 09:59:30 pm by Mattcus »

rob1221

  • *
  • Posts: 9473
I made a couple actors to test this and it works just fine.  Is it an actor behavior attached to the character?  Also, if you aren't seeing anything at all it could mean the coin is being drawn behind the character.

Mattcus

  • Posts: 24
The behaviour is attached to the icon and the coin is appearing but the problem is the coin won't go away.

rob1221

  • *
  • Posts: 9473
The only other difference I see is that your attribute is not hidden, but I don't know if that will change anything.

Mattcus

  • Posts: 24
It seems that but when the mouse is off the icon (The black one in the corner) the coin is still there.

(By the way everything in this picture is a placeholder until i finish the actual sprites)

rob1221

  • *
  • Posts: 9473
After looking at your image again I found the problem.  Move your "otherwise if" statement below the first "if" statement, not inside it.

Mattcus

  • Posts: 24
Oooh i see that thanks it works now. Now how do i make it that when you click on that icon it changes to that character on the next scene instead of the default one.

EDIT: Oh and would it be possible to make the image that appears (In this case the coin) changeable from the actor and not the actual behaviour so i don't have to make heaps of behaviours for each character.

rob1221

  • *
  • Posts: 9473
Yeah, just make an "actortype" attribute to replace the coin.

Mattcus

  • Posts: 24
Ok thanks that helped but now how do i start the next level with the new character i selected and not the default one?

rob1221

  • *
  • Posts: 9473
Hmm, you can't use a game attribute of "actortype", but you can use game attributes of "number" combined with "if" statements to tell the scenes which actor to create.  For example, if the character chosen is guy1, set the game attribute to 1 and in each scene say "if the game attribute is 1, create guy1."