Gamestudio Links
Zorro Links
Newest Posts
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
Data from CSV not parsed correctly
by jcl. 04/20/24 08:32
Zorro FIX plugin - Experimental
by jcl. 04/20/24 08:30
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (7th_zorro, Aku_Aku, 1 invisible), 579 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
2D Platform template + full collision and collision generator #465381
04/22/17 03:51
04/22/17 03:51
Joined: Feb 2013
Posts: 122
Maysville, Ga
Evo Offline OP
Member
Evo  Offline OP
Member

Joined: Feb 2013
Posts: 122
Maysville, Ga
2D Platform template + full collision and collision generator

After looking for different methods of creating 2D collision, I was scrolling through the AUM and came across a simple jump n run 2d platformer template created by MasterQ32. Its original features included smooth player movement, jumping and it used line based positions for collision detection with a ground line platform.

I really liked its simplicity and I seen this as a good chance to experiment with pixel_for_bmap a little more and see what new ideas I could create.

After testing some things, I have updated its design and included the following features :
* Added extra collision for players left side, right side, and head. Full collision is now included for all sides.
* The line based positions used for collision detection are now automatically created from a collision image and detect four colors that decide which type of collision it is.

How does it work?
Draw colored lines on a collision image (Like what is shown in the image below) to allow the code to auto generate the collision lines. The side of collision it creates is based on the color of the line.
(Red colored lines = ground) - RED(255).
(blue colored lines = ceiling) - BLUE(255).
(Green colored lines = leftwall) - GREEN(255).
(Dark Green colored lines = rightwall) - GREEN(100).

The collision layer itself is invisible. this example uses the collision layer image for the visual image so you can see your collision lines. Five collision images are included. Just change the Level image bmap and the collision bmap to a new collision image to see how it auto generates the collision points based off the pixel data.

BUG REPORT :
Update#1-5 : Fixed Known Issues...


NOTES :
* When drawing your collision layer, make sure the side collision lines stay in between the ground and ceiling lines. Look at the example images that are included for a better understanding of how to position your collision so that player does not fall or jump through corners.

DOWNLOAD :
platformer_Collision_System.zip






Re: 2D Platform template + full collision and collision generator [Re: Evo] #465417
04/26/17 10:47
04/26/17 10:47
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
It looks great! Thank you for sharing!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: 2D Platform template + full collision and collision generator [Re: 3run] #465427
04/26/17 19:58
04/26/17 19:58
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
Nice to see you making use of my code, can't test it right now, but still: cool!


Visit my site: www.masterq32.de

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1