Collision Box

SGDK only sub forum

Moderator: Stef

Post Reply
cloudstrifer
Very interested
Posts: 60
Joined: Mon Feb 19, 2018 7:31 pm

Collision Box

Post by cloudstrifer » Thu Mar 15, 2018 11:54 pm

Hi!
Is there any way to create a collision box without using a sprite?

Thank you!

Stef
Very interested
Posts: 2976
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Re: Collision Box

Post by Stef » Fri Mar 16, 2018 10:16 am

Nothing prevent you to use the 'Box' structure and do whatever you want with it =)

cloudstrifer
Very interested
Posts: 60
Joined: Mon Feb 19, 2018 7:31 pm

Re: Collision Box

Post by cloudstrifer » Fri Mar 16, 2018 4:08 pm

Sorry for asking too much.

But please. Could you show me an example?

Where can I find the SGDK documentation?

Thank you!

Miquel
Very interested
Posts: 448
Joined: Sat Jul 30, 2016 12:33 am

Re: Collision Box

Post by Miquel » Fri Mar 16, 2018 4:35 pm

I think he wants to display a box corresponding to the bounding box into the screen.

On MD you can only display things through sprites or tiles, to display a box with tiles is doable but very hard and will invalidate any work you have done before with them. So only remains doing it with sprites.

Another possibility is to have you game also running in you favourite OS.
It’s not what you think.
Perhaps, just perhaps, is our family making sure we listen from now on.
We need to talk about Mercury too.
We need to talk about so many things… I fear I don’t remember all.

cloudstrifer
Very interested
Posts: 60
Joined: Mon Feb 19, 2018 7:31 pm

Re: Collision Box

Post by cloudstrifer » Fri Mar 16, 2018 4:45 pm

I would like to do something like the hitboxes and hurtboxes of Street Fighter V, and that they could be visible (for testing) or invisible.

Image

Miquel
Very interested
Posts: 448
Joined: Sat Jul 30, 2016 12:33 am

Re: Collision Box

Post by Miquel » Fri Mar 16, 2018 5:00 pm

Yeah! is what I thought you meant.

The only viable option is sprites or to make you code run also on Windows/Linux/Mac/Whatever.
It’s not what you think.
Perhaps, just perhaps, is our family making sure we listen from now on.
We need to talk about Mercury too.
We need to talk about so many things… I fear I don’t remember all.

cloudstrifer
Very interested
Posts: 60
Joined: Mon Feb 19, 2018 7:31 pm

Re: Collision Box

Post by cloudstrifer » Fri Mar 16, 2018 8:21 pm

Thank you!

Stef
Very interested
Posts: 2976
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Re: Collision Box

Post by Stef » Fri Mar 16, 2018 11:20 pm

Oh sorry, i though you just wanted collision box in code ^^
So yeah as Miquel said, no other way than wasting some sprites for that.

Sik
Very interested
Posts: 879
Joined: Thu Apr 10, 2008 3:03 pm
Contact:

Re: Collision Box

Post by Sik » Sat Mar 17, 2018 12:59 am

If you want something relatively cheap, you can do like Sonic Pocket Adventure's debug mode, where only the corners are shown. You need four sprites for this (one for each corner, same graphic but flipped over in each of them), but they can easily adjust to any box shape as long as the box isn't tiny.
Sik is pronounced as "seek", not as "sick".

cloudstrifer
Very interested
Posts: 60
Joined: Mon Feb 19, 2018 7:31 pm

Re: Collision Box

Post by cloudstrifer » Sat Mar 17, 2018 7:07 pm

Thank you!

Post Reply