create event sheet for many characters

For questions about using Classic.

Post » Sun Jun 03, 2012 2:31 pm

In a game, like Super Smash Brawl, where you can select and control many characters, how should I design my event sheets for having multiple characters who share the same basic controls? For instance, all of them can move around and jump, sharing the same basic movement. This is clearly a call for platformer behavior. But what about other actions, for instance, like in Super Smash Brawl, we have Mario's action set, Link's action set, Sonic's action set, etc. All of these trigger different things.

Back in the old days, I would go to see some possibilities of appropriate design pattern, but now, with Construct, I am not sure the appropriate design pattern for event sheets in this case. If I am going to do something along the line like multiple characters in Super Smash Brawl, how should I approach this problem?
B
2
G
1
Posts: 38
Reputation: 526

Post » Sun Jun 03, 2012 2:44 pm

Currently, I am thinking of having a hitbox or a mask for a player character, then having multiple character objects defined. But only the character that the player select will be created at startup of the layout. The variables such as each character's speed, power, etc. will also be transferred to the mask object.

For the event sheets, all of actions will be there, and will look like this:

event keyAttack is press,
- subevent: all character A object, do certain something.
- subevent: all character B object, do certain something.
- subevent: all character C object, do certain something.

This is what I have in mind, but I want to hear from the community regarding this problem as well.
B
2
G
1
Posts: 38
Reputation: 526

Post » Sun Jun 03, 2012 3:03 pm

While I do recommend an invisible bounding box to be used across the board, one thing you could do (so as to avoid repeating the same control inputs over and over) is to have a broad player class that handles the control input and state handling and all the common features between characters, and then have little subclasses for each individual character. Like....

Player is a sprite with platform behavior
Mario and Sonic are both part of the "PlayerSprite" family

"Player Class"
if player state = "idle"
       if press right
              player move right
              PlayerSprite play anim "walk"
       if press left
              player move left
              PlayerSprite play anim "walk"
       if press attack
              set player state = "attack"
              PlayerSprite play anim "attack"
              PlayerSprite spawn AttackBox at imagepoint "attack"
       if press special
              set player state = "special"

"Mario Class"
if player state = "special"
       Mario play anim "throw_fireball"
       Mario spawn Fireball at imagepoint "fireball"
       if Mario anim "throw_fireball" finished
              set player state = "idle"

"Sonic Class"
if player state = "special"
       Sonic play anim "spindash"
       Sonic spawn AttackBox at imagepoint "spindash"
       if Sonic angle = 0
              Sonic set VectorX = 250
       elseif Sonic angle = 180
              Sonic set VectorX = -250
       if Sonic VectorX is between -50 & 50
              set player state = "idle"

Something like that. Not necessarily EXACTLY like that, but the idea there is how I'd do it.TL222012-06-03 15:04:51
B
58
S
20
G
7
Posts: 305
Reputation: 8,804


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests