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

Pages: 1-

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-30 18:50

Learn English.

Name: Anonymous 2008-03-30 19:20

>>2
<3
Usually it's me who posts that.

Name: Anonymous 2008-03-30 19:27

>>1
Read SICP.

Name: Anonymous 2008-03-30 20:53

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"

go the fuck back to /b/

Name: Anonymous 2008-03-30 21:12

>>5
We don't like your type around here.

Name: Anonymous 2008-03-30 21:28

NO EXCEPTION

Name: Anonymous 2008-03-30 21:33

lol thread

Name: Anonymous 2008-03-30 21:46

>>5
back to /pr/, please

Name: pg 2008-03-30 21:58

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.)

Name: Anonymous 2008-03-30 22:12

>>1,5
you must be GNU here.

Name: Anonymous 2008-03-30 22:23

>>11

You mean you must be GNU's Not Unix here

Name: Anonymous 2008-03-31 0:40

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.

Name: Anonymous 2008-03-31 0:44

>>13
DON'T HELP HIM!!!

Name: Anonymous 2008-03-31 0:48

>>14
That wasn't even helpful

Name: Anonymous 2008-03-31 0:51

>>15
DON'T HELP HIM!!!

Name: Anonymous 2008-03-31 2:39

USE PYTHAGORAS

Name: Anonymous 2008-03-31 3:12

>>1
So, you need help with THE GAME, right?  Well, you just lost it, THE GAME, that is.

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.

Name: Anonymous 2008-03-31 6:49

fewer checks per tick
lol

Name: Anonymous 2008-03-31 7:32

>>19
Oooooooo. So simple.

Ooooooooooooooo. I feel tingly.

Name: Anonymous 2008-03-31 7:39

Name: Anonymous 2008-03-31 7:42

>>22
DON'T HELP ME!

Name: Anonymous 2009-03-06 9:32


Java IS NOT SLOW.

Name: Trollbot9000 2009-07-01 8:42

The top left corner.

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