Collision Box

SGDK only sub forum

Moderator: Stef

Post Reply
User avatar
cloudstrifer
Interested
Posts: 23
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!

User avatar
Stef
Very interested
Posts: 2757
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 =)

User avatar
cloudstrifer
Interested
Posts: 23
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: 292
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.
At light speed you can see quite clear close and distant starts alike with a solid trail of light, like in a highway close ones go more quickly.
But the close ones have a blue glow (but not a trail), kind of Doppler effect perhaps?

User avatar
cloudstrifer
Interested
Posts: 23
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: 292
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.
At light speed you can see quite clear close and distant starts alike with a solid trail of light, like in a highway close ones go more quickly.
But the close ones have a blue glow (but not a trail), kind of Doppler effect perhaps?

User avatar
cloudstrifer
Interested
Posts: 23
Joined: Mon Feb 19, 2018 7:31 pm

Re: Collision Box

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

Thank you!

User avatar
Stef
Very interested
Posts: 2757
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.

User avatar
Sik
Very interested
Posts: 688
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".

User avatar
cloudstrifer
Interested
Posts: 23
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

Who is online

Users browsing this forum: No registered users and 1 guest