Platformer : why do we need to use an hitbox?

For questions about using Classic.

Post » Fri May 27, 2016 8:05 pm

Hi there!

In almost all tutorials I've seen/read about platformer with Construct Classic it says to use an invisible hitbox and to set position of the picture of your charachter to follow the position of the hitbox.

And I don't really get why ?

Why is it not adviced to directly assign the platform behavior to the picture of your charachter ?

Thanks for clearing this thing up to me :)

Cheers!

// izioq //

@R0J0hound Sorry to tag you but you're kind of a Construct god here :)
B
4
S
1
Posts: 24
Reputation: 380

Post » Fri May 27, 2016 8:49 pm

As far as I know it is not mandatory for C2.
Other engines need a hitbox to work correctly.

But it still makes sense to use one
- If you change the animation of your player the hitbox stays the same
- you can make your player out of a lot of different smaller sprites (like head, weapon,...) but only need to check collision on the hitbox

  • System > On start of layout | system > load game from slot "brain"
  • System > On load failed | system > scroll to obj_Forum
B
17
S
8
G
5
Posts: 340
Reputation: 4,707

Post » Fri May 27, 2016 9:06 pm

Thanks for your reply!

" - If you change the animation of your player the hitbox stays the same "

That's my problem in fact : when my player jump he is smaller than the hitbox and if I make the hitbox stretch I got some issues when it hits the ground (screen shaking)

However in the game I'm working on, there are no enemies (but the player will still have to pull triger, toggle switch, etc.)... so maybe I don't need an hitbox in fact ?
B
4
S
1
Posts: 24
Reputation: 380

Post » Fri May 27, 2016 9:15 pm

I think you can make it without a hitbox, but you also could switch to a smaller hitbox when player get's small.

  • System > On start of layout | system > load game from slot "brain"
  • System > On load failed | system > scroll to obj_Forum
B
17
S
8
G
5
Posts: 340
Reputation: 4,707

Post » Fri May 27, 2016 9:18 pm

Thanks: I'll give a go without a hitbox :)
B
4
S
1
Posts: 24
Reputation: 380

Post » Sat May 28, 2016 5:34 am

@izioq - You should always use a hitbox on platformer games since any change of collision points or size of the player will produce a glitch on solid objects.
The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
65
S
21
G
90
Posts: 1,124
Reputation: 59,852

Post » Sat May 28, 2016 7:38 am

That's an important precision thank you very much @chadorireborn !
B
4
S
1
Posts: 24
Reputation: 380

Post » Mon May 30, 2016 3:15 pm

Don't forget that cc allows you to make custom collision masks for your sprites and use that mask on all animation frames .
What I know would fill a Book , what I don't know would fill a Library
B
37
S
12
G
29
Posts: 331
Reputation: 16,499

Post » Tue May 31, 2016 3:21 am

Just how much slower does is the game if I use more than 8 points on my hitboxes?

I've seen pixel-perfect collisions in other game engines without slowdowns.
Don't get me wrong; I have no problems with using a standard square hitbox for my character (afterall, Mario speed runs would be very difficult if collision were pixel-perfect) but it's also nice to have the option.
Image Image Image
B
31
S
11
G
27
Posts: 748
Reputation: 17,093


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests