Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (M_D), 1,430 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Collision problem [Re: Gastara] #330022
06/24/10 20:31
06/24/10 20:31
Joined: Apr 2006
Posts: 737
Ottawa, Canada
O
Ottawa Offline
User
Ottawa  Offline
User
O

Joined: Apr 2006
Posts: 737
Ottawa, Canada
Hi!

I looked at the AUM84's png and tga in my paint program
The code in the AUM reacts to the size of these bmaps and is very flexible.

Do your bmaps have the same size in pixels?

Your code, I believe, will not be flexible because you use : coords1_x = 700; in the while loop. Your bmp returns to this position every time the loop is made.

Playing with AUM code wink
Ottawa wink

Re: Collision problem [Re: Ottawa] #330027
06/24/10 21:19
06/24/10 21:19
Joined: Jun 2007
Posts: 15
Norway
G
Gastara Offline OP
Newbie
Gastara  Offline OP
Newbie
G

Joined: Jun 2007
Posts: 15
Norway
Hi!

Hm, yes I think I understand. I use 700 because my background image is 1400 in width and do the check against each side since the red color is in the middle.
Yes, I agree, it’s maybe not flexible, but it works fine for bottom and top of the player.
Not solved the sides yet. I will however try to find another solution and not do the check as in my last example.
Anyway, if you tested the code in AUM you maybe notice that the player is inside the water a little.
That’s no problem to solve. The big problem is just this corner glitch or what I shall call it. So I agree, it’s best to find another solution.

Last edited by Gastara; 06/24/10 21:22.
Re: Collision problem [Re: Gastara] #330030
06/24/10 22:57
06/24/10 22:57
Joined: Apr 2006
Posts: 737
Ottawa, Canada
O
Ottawa Offline
User
Ottawa  Offline
User
O

Joined: Apr 2006
Posts: 737
Ottawa, Canada
Hi Gastara!

The part of the player that is in (over) the water is the head.
But the feet are on solid ground.

Play with 2dcollision4.c. Go around the water part in a very tight
circle (rectangle wink ). You will notice that part of the head is always
in (over) the water zone at the bottom.
The perspective of the player being close
to the water and the head over the water is very normal. Take a picture
of yourself near a pond or a lake. wink

My suggestion is to keep this great code and to play with your
.tga or png
Then only modify the distance in lines like : coords2_y = my_player.pos_y + 20; // play with 20


Hope this helps!
Ottawa laugh

Ver 7.86.2 Pro and Lite-C
Re: Collision problem [Re: Ottawa] #330038
06/25/10 05:47
06/25/10 05:47
Joined: Jun 2007
Posts: 15
Norway
G
Gastara Offline OP
Newbie
Gastara  Offline OP
Newbie
G

Joined: Jun 2007
Posts: 15
Norway
Hi!

Yes, I see the logical with the sprite used in that example (AUM 84 - 2dcollision4), and it works fine then.
I just removed the + 20 from (coords2_y = my_player.pos_y;) in player head since I don’t want some part of players head to be inside the red color in this case.
At the corner it blocks only the half of the player since it’s divided by 2.
That’s logical since when more than half of the player is outside the red colors edge, it will not block.
That’s fine with the code from AUM, but thinks about it like a Pong game. If the player head is the ball,
it would not block correctly when it reaches the pad. If half of the player is outside the corner of the pad, it will pass through.
Without /2, it will block all the width of the player when it reaches the pad, but just on one corner.

PS! I’m not going to make a pong game with this code solution. smile

Pong examples:

Here it blocks fine when divided by 2


Here it don’t block since more than half of the player are on the outside of the red color.


If I remove / 2 it block all the players width fine


but not at the opposite corner when some part of the player are ouside the red color


I will anyway try to find a solution for this without the if statements I used in my last example smirk .





Last edited by Gastara; 06/25/10 05:53.
Re: Collision problem [Re: Gastara] #330045
06/25/10 09:20
06/25/10 09:20
Joined: Jul 2007
Posts: 959
nl
F
flits Offline
User
flits  Offline
User
F

Joined: Jul 2007
Posts: 959
nl
i have been playing with this for a while and this is what i did create

http://www.opserver.de/coni_users/web_users/pirvu/au/demo/zips/collision.zip

but if you want a better solution there is even a better one on the aum resorce demo's page


"empty"
Re: Collision problem [Re: flits] #330048
06/25/10 10:15
06/25/10 10:15
Joined: Jun 2007
Posts: 15
Norway
G
Gastara Offline OP
Newbie
Gastara  Offline OP
Newbie
G

Joined: Jun 2007
Posts: 15
Norway

Nice, thank you. I shall look at it. smirk

Page 2 of 2 1 2

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