Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Java 1.5/1.6 Game

Name: Ashrubel 2008-03-30 18:38

Okay, i have a good bit of experience using Java and i need a tip before i start my next game... i have already (for a class) prgrammed a Tank game (more of a simulator for maximization protocils) and i am going to make a real game now...

I have just one problem... how do i handle Collisions:
i.e. if my character or whatever runs into a wall. (it will be a simple top-down 2D Shooter, and i need a tip on how to deal make borders and obstuctions work properly.

For one: I have only ever used stuff like 2D arrays to determine if the space is occupied, that unortunately will be too innefective. so i wanna use a fast and simple method for checking for collsions...

any help....

Name: Anonymous 2008-03-31 5:24

>>13
Another way is to just have one set of coordinates for each entity on the screen and say it collides if it's within X pixels of another entity, where X varies with the entity's size on the screen.
It's not perfect, but at least you don't need enormous arrays of booleans, and you'll be doing fewer checks per tick on average.

Both of these are pretty horrible, though.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List