Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (Nymphodora, AndrewAMD, TipmyPip, Quad, Imhotep), 847 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
(Solved) Need some help with AUM84 - 2dcollision3.c #465294
04/16/17 00:28
04/16/17 00:28
Joined: Feb 2013
Posts: 122
Maysville, Ga
Evo Offline OP
Member
Evo  Offline OP
Member

Joined: Feb 2013
Posts: 122
Maysville, Ga
George and Community,

I have currently been wanting to start a new 2D game builder that hopefully improves upon my last effort.

But before I start the new project, I have been looking into trying to find a pixel-collision detection that I can start with as a base for a new 2d collision system. I had recently converted a few 2d collision algorithms from HTML5/JS, but they weren't what I really needed.

When AUM84 first came out, I had attempted to update the 2dcollision3.c script that uses the red pixel color for detection, but eventually ran into the problem that I have no idea how to actually "move" the collision. It stayed stationary on the screen at all times and I couldn't find a way to do it. The BMAP called is not set as a panel and is read by the code within the players movement.

My 2D game builder is designed to move the player when their near the edge of a map and when the player walks over and gets center screen, player keeps animating, but then its the world that moves to simulate a 2D camera.

My Question :
Is there a way that this can be set up so that the BMAP image used for collision is set as a movable panel layer during gameplay? If so, would it still be able to detect the red pixels that the player comes into contact with in the same way that it does in the demo?

Solved:
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=465319#Post465319

Thank you for your time,
Brian Pressley

Re: Need some help with AUM84 - 2dcollision3.c [Re: Evo] #465295
04/16/17 05:54
04/16/17 05:54
Joined: Aug 2003
Posts: 118
Deutschland
E
Ezzett Offline
Member
Ezzett  Offline
Member
E

Joined: Aug 2003
Posts: 118
Deutschland
In Aum 84 the level bitmap is already used for a PANEL called level_pan.

Maybe you could try this:
- move the panel when your player reaches the center of the screen
- read out pos_x and pos_y of the panel
- read out the pixel of the bitmap with the help of pos_x and pos_y to include the movement

pixel = pixel_for_bmap(level_tga, coords_x - pos_x, coords_y - pos_y);

Be careful not to read a pixel outside of the bitmaps size.


There should be no speed difference. It would cost time if you check each frame that you're not outside the bitmap when reading a pixel.

Re: Need some help with AUM84 - 2dcollision3.c [Re: Ezzett] #465296
04/16/17 06:21
04/16/17 06:21
Joined: Feb 2013
Posts: 122
Maysville, Ga
Evo Offline OP
Member
Evo  Offline OP
Member

Joined: Feb 2013
Posts: 122
Maysville, Ga
Thanks. Works great. Now the collision moves as I need it to.

It will take some work to turn AUM84 2D collision into a decent pixel-perfect system, but it's a good simplified foundation to start on.

Thank you very much Ezzett.

Re: Need some help with AUM84 - 2dcollision3.c [Re: Evo] #465320
04/17/17 17:46
04/17/17 17:46
Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
George Offline

Expert
George  Offline

Expert

Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
It's good to hear that Ezzett's solution works fine.


Moderated by  George 

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