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...
wow... are you serious? I come here and ask just a simple question about collisions and you attack me on my fucking grammar... are you a fucking english teacher?
i am in a cramped working space on a laptop fagass, that means i will miss a couple of fucking keys.... obiously the topic is beyond your comprehension and your only fucking response is "l2Engrish"
Java was, as Gosling says in the first Java white paper, designed for average programmers. It's a perfectly legitimate goal to design a language for average programmers. (Or for that matter for small children, like Logo.)
Just a thought: What if you made a "rough" grid, of "pixels" that are like 5x5 large, binary. If Object is in them at all, they are on. If another object is in the same or an adjacent "block", go to the high res, pixel-by-pixel physics. Make sure to watch out for memory leaks, shit like this would almost certainly cause memory leaks.
Just a though, not even at a pseudocode level.
Inb4 lolwat ur not sposed 2 help on /prog/, and in after SICP.
>>1
So, you need help with THE GAME, right? Well, you just lost it, THE GAME, that is.
Name:
Anonymous2008-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.