create event sheet for many characters

This forum is currently in read-only mode.
From the Asset Store
- This pack is suitable for shooting games, running games, platform games, and side-scrolling...
  • 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?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

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

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)