Gamestudio Links
Zorro Links
Newest Posts
Can't plot daily high & low
by Zheka. 10/14/19 18:39
TWS "Market closed" fix
by jcl. 10/14/19 15:09
2xCapital slider to increase size
by jcl. 10/14/19 14:03
Imgui Lite-c Development
by txesmi. 10/13/19 09:40
A9
by Dooley. 10/11/19 18:53
Need Help Finding Cause of Crash
by Dooley. 10/11/19 18:51
What algorithm is used for BALANCED?
by JamesHH. 10/11/19 17:32
AUM Magazine
Latest Screens
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Who's Online Now
7 registered members (exile, Dooley, Dalla, kvm, sdh309795gaas, jibanes, Zheka), 661 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
FrankW, TedMar, raimucuk, vivaldi2, filip
18304 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: 101
Maysville, Ga
EVO Offline OP
Member
EVO  Offline OP
Member

Joined: Feb 2013
Posts: 101
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: 114
Deutschland
E
Ezzett Offline
Member
Ezzett  Offline
Member
E

Joined: Aug 2003
Posts: 114
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: 101
Maysville, Ga
EVO Offline OP
Member
EVO  Offline OP
Member

Joined: Feb 2013
Posts: 101
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,007
Bucharest, Romania
George Offline

Expert
George  Offline

Expert

Joined: Aug 2003
Posts: 2,007
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