Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Trading Journey
by howardR. 04/24/24 20:04
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Ayumi, AndrewAMD), 822 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 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