Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Create polygon collision shapes?

Author
Message
Fluorescent
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 1st Aug 2005
Location: Stockholm, Sweden
Posted: 25th Nov 2014 16:58
Hello
I have a sprite that is sort of triangle shaped and I want the collision shape to be sort of triangle shaped also. But inset into the bigger triangle of the sprite. So that when the player walks on it they appear to be sort of inside the sprite.

The idea is that it supposed to be sort of 2.5D, maybe more of 2 and a smidge D.

Anyhow, if anybody understands what I'm trying to achieve and has a small example that I can look at, I would be very grateful.

Attachments

Login to view attachments
Funnell7
13
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 25th Nov 2014 17:03 Edited at: 25th Nov 2014 17:06
Take a look at this;

http://appgamekit.com/documentation/Reference/Sprite/SetSpriteShapePolygon.htm

I've never actually used it, but think this is what you are after...

EDIT: Just found this too (searched for 'Polygon' in the forum threads);

http://forum.thegamecreators.com/?m=forum_view&t=210867&b=41
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 26th Nov 2014 08:52
You can use my free tool for creating complex shapes: ShapeUp

Using the SetSpriteShapePolygon is easier where you need to be precise. Just remember the main rules for creating shapes:
1-Create shapes in the clockwise direction
2-Create only convex shapes. Concave shapes can be made from multiple polygons using AddSpriteShapePolygon for subsequent shapes

Try experimenting with my tool as it will tell you when you are drawing a shape incorrectly.
Fluorescent
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 1st Aug 2005
Location: Stockholm, Sweden
Posted: 27th Nov 2014 17:04
Thank you baxslash! The facts that the shape must be in clockwise direction and convex is great and very important.

Your tool is great also. Thank you.

Login to post a reply

Server time is: 2024-11-25 11:40:04
Your offset time is: 2024-11-25 11:40:04