Re: Collision detection in 2d games when turning is a thing?

2014-12-20 Thread AudioGames . net Forum — Developers room : stewie via Audiogames-reflector
Re: Collision detection in 2d games when turning is a thing? I would personally use target_x-player_x, since if you do the reverse youll get the negative values of what they should be. URL: http://forum.audiogames.net/viewtopic.php?pid=197914#p197914

Re: Collision detection in 2d games when turning is a thing?

2014-12-20 Thread AudioGames . net Forum — Developers room : stewie via Audiogames-reflector
Re: Collision detection in 2d games when turning is a thing? I would personally use target_x-player_x, since if you do the reverse youll get the negative values of what they should be. Also you could totate both the object and the point about 0 0 by the angle of the tested object, so

Re: Collision detection in 2d games when turning is a thing?

2014-12-20 Thread AudioGames . net Forum — Developers room : stewie via Audiogames-reflector
Re: Collision detection in 2d games when turning is a thing? I would personally use target_x-player_x, since if you do the reverse youll get the negative values of what they should be. Also you could rotate both the object and the point about 0 0 by the angle of the tested object, so

Re: Collision detection in 2d games when turning is a thing?

2014-12-19 Thread AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
Re: Collision detection in 2d games when turning is a thing? You have gone well beyond what BGT can do for you. Leave for C++, C#, Python, or any other language wherein you can find bindings to either ODE or Box2d. Learn and use those; Box2d is much easier than ODE, but ODE lets you use

Re: Collision detection in 2d games when turning is a thing?

2014-12-19 Thread AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
Re: Collision detection in 2d games when turning is a thing? You have gone well beyond what BGT can do for you. Leave for C++, C#, Python, or any other language wherein you can find bindings to either ODE or Box2d. Learn and use those; Box2d is much easier than ODE, but ODE lets you use

Re: Collision detection in 2d games when turning is a thing?

2014-12-19 Thread AudioGames . net Forum — Developers room : Dranelement via Audiogames-reflector
Re: Collision detection in 2d games when turning is a thing? Hi, thats almost what Ive been trying to do. My player is moving with double precision though, so I have been having a bit of trouble. Heres my player class, it, might help explain things.https://www.dropbox.com/s/ftt153iohif5c

Re: Collision detection in 2d games when turning is a thing?

2014-12-19 Thread AudioGames . net Forum — Developers room : Dranelement via Audiogames-reflector
Re: Collision detection in 2d games when turning is a thing? Hi, thats almost what Ive been trying to do. My player is moving with double precision though, so I have been having a bit of trouble. Heres my player class, it, might help explain things.https://www.dropbox.com/s/ftt153iohif5c

Re: Collision detection in 2d games when turning is a thing?

2014-12-19 Thread AudioGames . net Forum — Developers room : Dranelement via Audiogames-reflector
Re: Collision detection in 2d games when turning is a thing? Hi, thats almost what Ive been trying to do. My player is moving with double precision though, so I have been having a bit of trouble. Heres my player class, it, might help explain things.https://www.dropbox.com/s/ftt153iohif5c

Re: Collision detection in 2d games when turning is a thing?

2014-12-19 Thread AudioGames . net Forum — Developers room : Aprone via Audiogames-reflector
Re: Collision detection in 2d games when turning is a thing? Dranelement, does this mean you already have your guy walking around freely in 2D space? So just wall collision is the issue?Since you already have code to calculate the new X Y position of the player after he takes a step

Re: Collision detection in 2d games when turning is a thing?

2014-12-19 Thread AudioGames . net Forum — Developers room : Dranelement via Audiogames-reflector
Re: Collision detection in 2d games when turning is a thing? Hi, thanks very much, that was very helpful! I have actually tried to do that, however I now sometimes get the problem where even if Im not actually facing a wall, Ill still run into the thing. I think your idea of the sliding

Re: Collision detection in 2d games when turning is a thing?

2014-12-19 Thread AudioGames . net Forum — Developers room : Aprone via Audiogames-reflector
Re: Collision detection in 2d games when turning is a thing? Dranelement, I dont think I understand. Why would you only collide with a wall you are facing? URL: http://forum.audiogames.net/viewtopic.php?pid=197840#p197840 ___ Audiogames

Re: Collision detection in 2d games when turning is a thing?

2014-12-19 Thread AudioGames . net Forum — Developers room : Dranelement via Audiogames-reflector
Re: Collision detection in 2d games when turning is a thing? I, guess I didnt really think of it that way. I should probably add some way for a player to check whats around them. URL: http://forum.audiogames.net/viewtopic.php?pid=197841#p197841

Re: Collision detection in 2d games when turning is a thing?

2014-12-19 Thread AudioGames . net Forum — Developers room : Aprone via Audiogames-reflector
Re: Collision detection in 2d games when turning is a thing? Sounds good man.Whenever you feel like posting, Im sure were all happy to read about your progress. URL: http://forum.audiogames.net/viewtopic.php?pid=197842#p197842

Re: Collision detection in 2d games when turning is a thing?

2014-12-19 Thread AudioGames . net Forum — Developers room : Dranelement via Audiogames-reflector
Re: Collision detection in 2d games when turning is a thing? Thanks again for all the help, guys. Im learning a lot from this, and you have been incredibly helpful. URL: http://forum.audiogames.net/viewtopic.php?pid=197844#p197844

Re: Collision detection in 2d games when turning is a thing?

2014-12-19 Thread AudioGames . net Forum — Developers room : stewie via Audiogames-reflector
Re: Collision detection in 2d games when turning is a thing? Id personally do target_x-player_x, not the other way around because you can do the following.If you need to get the angle between an angle, you can use:angle = atan(sin(target_y-player_y)/cos(target_x-player_x))If you have

Re: Collision detection in 2d games when turning is a thing?

2014-12-19 Thread AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
Re: Collision detection in 2d games when turning is a thing? If no one has told you, velocities can also be represented as unit vectors times a magnitude. I am almost certain that you know this. You probably want to use your velocity vector as the place to check, not the vector represented

Collision detection in 2d games when turning is a thing?

2014-12-18 Thread AudioGames . net Forum — Developers room : Dranelement via Audiogames-reflector
Collision detection in 2d games when turning is a thing? Hi, Im wondering what the best way to implement collision detection for walls, pits, and other objects is in games when angles are involved. Ive tried to do some research online, but havent really come up with much. Ive gotten

Re: Collision detection in 2d games when turning is a thing?

2014-12-18 Thread AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
Re: Collision detection in 2d games when turning is a thing? arc tangent is the inverse of tangent: you give it a tangent, and it returns the angle. Youd use this, say, if you have sets of coordinates, but need an angle. theta=arc_tangent(dy/dx) (but be sure to catch when dx is 0

Re: Collision detection in 2d games when turning is a thing?

2014-12-18 Thread AudioGames . net Forum — Developers room : Dranelement via Audiogames-reflector
Re: Collision detection in 2d games when turning is a thing? Hi, oh, I didnt realize you could do that. Lots of the atan functions Ive seen ask for an x and a y so...As for walls and the player, walls are represented by a 2d array of bools, which is my problem, I think. The player

Re: Collision detection in 2d games when turning is a thing?

2014-12-18 Thread AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
Re: Collision detection in 2d games when turning is a thing? A 2d array of bools should be easy: just figure out what tile youd be hitting next, and do a check for it.The problem is one of resolution. Should I assume that each wall/floor tile is roughly the size of the player? Does

Re: Collision detection in 2d games when turning is a thing?

2014-12-18 Thread AudioGames . net Forum — Developers room : tward via Audiogames-reflector
Re: Collision detection in 2d games when turning is a thing? @Dranelement, the correct way to handle this requires some knowledge of trigonometry for a simple collision detection system or calculus for a more complex system. In any case look for calculations to handle bounded boxes