Is there any advantage in a game for player/enemies to have separate "Bases" and "Masks" Sprites?

0 favourites
  • 6 posts
From the Asset Store
Basic Rounded Vector Geometry Player Design with Glow for 3 player games
  • I've noticed in a lot of sample games I've seen that developers use two sprite objects to represent the player and/or enemies. The "base" is generally a simple square sprite, and the "mask" is the actual character sprite with animations. They are generally pinned to each and/or put in a container together and act as one unit on the layout.

    I understand why you would want this when you are using the Physics plugin (from reading the tutorial), as it allows you to have an animated sprite with a changing shape while still maintaining a simple collision box for the physics.

    However, I still see this done even in games that aren't using Physics, such as the example game Demonaire in the construct recommended examples. Is there another purpose to this practice?

  • There are potential benefits in terms of collisions logic, organization of events, and flexibility of animations. Many things can be done multiple ways. It depends on the preference of the author which way they are more comfortable working with.

    For Demonaire, there are still collisions to account for despite not utilizing physics.

    Speaking in general, for a more extreme example consider a fighting game like Street Fighter, which uses multiple helper collision boxes separate from the animated sprite, such as hitboxes, hurtboxes, and pushboxes.

  • Thanks for the feedback oosyrag!

  • Okay, replied before I really thought about your response. You say collisions are still used without physics, but why would you need a separate base for that? Can't you still have collisions on an animation sprite? Disregarding a fighting game, or any other game where multiple precise hitboxes are critical, couldn't you just create a hit box with Constructs flexible collision geometry? I'm asking specifically in the context of the Construct engine.

  • You can have collisions on an animated sprite.

    You don't need them separate.

    I find it is helpful organizationally to separate the underlying collision logic from animations myself. Animations can change shapes, sizes, and origin points which may have an effect on collisions. When dealing with a lot of animation frames or when making changes to animations, it is pretty common to accidentally introduce hard to spot irregularities in regards to bounding boxes.

    Tldr you definitely don't have to, but many people do so as a "best practice".

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I see! I haven't gotten much to animation yet, I haven't even used a timeline yet. That makes sense given what I know. And point taken about basing your collisions on an animation that can change size and shape each frame. Thank you.

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