# Chaoslab

Member

102

116 Neutral

• Rank
Member
1. ## [java] ConcurrentModificationException

I have to ask why I you making this so complicated? I would of done it like this, could be placed in its own class. final int numStars = 30; double starX[] = new double [numStars]; double starX[] = new double [numStars]; All you need to do is when a star passes of the side of you place it on the other side with a random y and like wise for sides the leave the top / bottom of the screen. link lists for something as simple as this is overkill, kind of like shooting an ant with a cannon and is much more efficient CPU wise. And you could even add color as well! Just some ideas.... :-)
2. ## [java] Giving applets Focus first

I think there is some java script you can call to set the input focus on a page so that could be the place to start :-)
3. ## hidden surface removal question

Quote:Original post by magneeto should i use a plane equation Ax+By+Cz=D or surface normals to determine visibility?? i'm not very familiar with the plane equation method. if i try to break my cube into having 12 triangles for six faces then for the visibility of a face do i need to consider both the triangles or just one? which one is better -- calculating normals for triangles or solving the plane equation?? Ass long as the Polygon is flat you only need to use the first 3 points of the polgon to check if the surface is visible (as per the code I posted). :-)
4. ## hidden surface removal question

Convex hidden surface removal is quite easy. All your surface points must be in clockwise (or anti clockwise, cant remember) in order for this to work. ax = point 1 x ay = point 1 y bx = point 2 x by = point 2 y cx = point 3 x cy = point 3 y if((bx - ax) * (cy - ay) - (by - ay) * (cx - ax) > 0) { // draw surface yada yda } else { // surface hidden } This little code snippet come all the way with me from my Amiga coding days.... :-)
5. ## [java] help with the java vector class

Also don't used a syncronized list class if you don't have to. ArrayList is allot faster than Vector because vector is syncronzied. :-)
6. ## [java] Writing to a file

Applets cannot write to files as they run from a sand box. From what you have described I suggest you look into a server side solution as applets can get and post things to the server they are served from.
7. ## [java] Java compilers/editors (which to use?)

Java compiler - JDK 1.5 IDES - Eclipse - Code Slayer - my own custom IDE with visual code modelling and auto generation of infrastrure solutions in DB / XML / XSD / Raw. :-)
8. ## [java] Anyone ever completely replaced GUI graphics before?

I wrote my own GUI / Event model from scratch as I had real time requirements that swing and awt could not satisfy. But such is the nature of game programming. It isn't that hard really if you put in a bit of research and design before hand. :-)
9. ## [java] Fullscreen in Linux

Try looking for a command in linux that changes (and hopefully restores) desktop / screen resoution and make that part of your shell script to run the game. It is a real pain that this problem is still around and has been so for quite a few years.
10. ## [java] I'm lost in the world of game development.

nasty evil disclaimer made me triple post....
11. ## [java] I'm lost in the world of game development.

nasty evil disclaimer made me double post....
12. ## [java] I'm lost in the world of game development.

Code your own IDE.... I wrote my own IDE called CodeSlayer about a year and a half ago and in the process created a whole new GUI and Image processing API which toasts swing as far as game development is concerned and the modeled inside Code Slayer and persistance as nice readable XML.... CS also autogenerates all of the infrastructure code for my data modelling and merges it into existing source. One of the main reasons I did it was the fact that I could port all of my gui and interfacer code to another lang if required later on (as a fall back to C# if so required) :-)

Sorted