Search found 355 matches

by datwill310
May 01, 2017 22:55
Forum: Game Dev
Topic: Need help with 2d collision ASAP
Replies: 58
Views: 7202

Re: Need help with 2d collision ASAP

Here you can move the red rectangle around using the arrow keys while the values are printed. The direction of the red rectangle is given by rec1.xd and rec1.yd so if it is moving from the left xd=1 and yd=0 and if moving down xd=0 and yd=1. The angle is between the centroids of the rectangles. Tha...
by datwill310
May 01, 2017 22:43
Forum: Game Dev
Topic: Need help with 2d collision ASAP
Replies: 58
Views: 7202

Re: Need help with 2d collision ASAP

MrSwiss wrote:Sorry, to butt in but, the quoted function of *m* is different, than on Wikipedia:

m = (y2 - y1) / (x2 - x1)

Also, the page states that:

m = tan(θ)

Where θ is the angle defined by the x axis and linear line drawn on the Cartesian plane.
by datwill310
May 01, 2017 22:08
Forum: Game Dev
Topic: Need help with 2d collision ASAP
Replies: 58
Views: 7202

Re: Need help with 2d collision ASAP

how to find the angle between two points? SLOPE What is meant by "calculate slope"? Is it like finding the gradient? Would that alone work? It just tells me how steep our character has entered into the entity, not the direction definitively, e.g. if gradient is shallow (if we are defining...
by datwill310
May 01, 2017 21:51
Forum: Game Dev
Topic: Need help with 2d collision ASAP
Replies: 58
Views: 7202

Re: Need help with 2d collision ASAP

how to find the angle between two points? SLOPE What is meant by "calculate slope"? Is it like finding the gradient? Would that alone work? It just tells me how steep our character has entered into the entity, not the direction definitively, e.g. if gradient is shallow (if we are defining...
by datwill310
May 01, 2017 21:39
Forum: Game Dev
Topic: Need help with 2d collision ASAP
Replies: 58
Views: 7202

Re: Need help with 2d collision ASAP

in regards to your questions regarding BasicCoders code... what it does is iterate through all 4 corners of one object, comparing each corner to see if it is 'inside' the rectangle of the other object... it does this by seeing if: Checking Collision for OBJ-A against OBJ-# is OBJ-A corner #1 x-valu...
by datwill310
May 01, 2017 21:03
Forum: Game Dev
Topic: Need help with 2d collision ASAP
Replies: 58
Views: 7202

Re: Need help with 2d collision ASAP

for the direction, use the slope comparison method described above - it will basically tell you the angle between the two objects (you will still have to figure out what you want to happen at exactly 45 degrees though - your 'corner' issue) and from the angle you can figure out how to react. One qu...
by datwill310
May 01, 2017 20:59
Forum: Game Dev
Topic: Need help with 2d collision ASAP
Replies: 58
Views: 7202

Re: Need help with 2d collision ASAP

(I will respond to in-coming posts). In one game demo I used this to return which side was hit, Forgive me for my noobish questions here, but... I'm not sure if I understand how the code finds out where sprite one has collided with sprite two. For instance, take the checking for the top/left corner:...
by datwill310
May 01, 2017 20:23
Forum: Game Dev
Topic: Need help with 2d collision ASAP
Replies: 58
Views: 7202

Re: Need help with 2d collision ASAP

BasicCoder2 wrote:In one game demo I used this to return which side was hit,

Thanks for your input. I will look over the code you have posted now.
by datwill310
May 01, 2017 20:22
Forum: Game Dev
Topic: Need help with 2d collision ASAP
Replies: 58
Views: 7202

Re: Need help with 2d collision ASAP

what your looking to do is the heart of any interface engine...hence why some games work way better then others... you want to be able to scan areas and check for collision fast, its hard to explain a good way for your program to check collision without knowing how you handle the objects that colli...
by datwill310
May 01, 2017 20:07
Forum: Game Dev
Topic: Need help with 2d collision ASAP
Replies: 58
Views: 7202

Re: Need help with 2d collision ASAP

if player doesn't move one pixel at a time then just add the actual movement to player before actually displaying it on screen and check for collision, like use collision_result=0 if playerx+10>=collisionx and playerx-10<=collisionx then collision_result=1 ... ... ... do this will all axis availabl...
by datwill310
May 01, 2017 17:25
Forum: Game Dev
Topic: Update???
Replies: 6
Views: 1821

Re: Update???

Been scanning some of this Game dev thread, and have spotted this recent post:

viewtopic.php?f=15&t=25404

Check it out ;) maybe this might answer some questions? Not too sure though, I've not read all of it.
by datwill310
May 01, 2017 17:16
Forum: Game Dev
Topic: Need help with 2d collision ASAP
Replies: 58
Views: 7202

Need help with 2d collision ASAP

Hi all at the forum, I'm currently very busy with programming a new game, all programmed in Free BASIC (except some of the actual libraries I use etc. :P). And have hit a dead-end concerning collision. Our game is a 2D platformer. The .stg files (stage info) store a list of entities in the stage, an...
by datwill310
May 01, 2017 16:38
Forum: Game Dev
Topic: Update???
Replies: 6
Views: 1821

Re: Update???

Was just finding out about this site last night :)
I too notice that the last update was a good few years ago.
by datwill310
Apr 09, 2017 15:04
Forum: Community Discussion
Topic: Download Website Security Issue FIXED
Replies: 13
Views: 1929

Re: ATTENTION TO FB DEV - DOWNLOAD WEBSITE SECURITY ISSUE?

counting_pine wrote:Just to say, Sourceforge have updated their [www.]sf.net certificate now. It will expire on 8 May next year.

Will update the original topic title.
by datwill310
Apr 09, 2017 13:30
Forum: Beginners
Topic: FreeImage and Displaying Images *SOLVED*
Replies: 32
Views: 3274

Re: FreeImage and Displaying Images

:facepalm:
I was using pset as the blitting method instead of alpha...
Problem solved.

Go to advanced search