I am making a game where you are a space ship and there are other space ships that shoot lasers at you. I want the enemies to be able to shoot a laser by making a new laser object and when it reaches the end of he screen or hits its target it does its damage and gets removed from memory (lasers will be in an arraylist because there are multiple types of lasers). I want each laser to be stored in its parent classes array list but i don't know much about parents and childs in programming. I couldn't find a good tutorial anywhere on the processing website either. Can anyone tell me how to use parents and such, or think of a better way to shoot lasers?
I am making a 3D program, where you use the mouse to look around and the code for my camera movement is:
float camZ = (height/2.0) / tan(PI*60.0 / 360.0);
camera(width/2, height/2, camZ, // Camera location
mouseX, mouseY/2.0, 0, // Camera target
0, 1, 0); // Camera orientation
Which is built off of an example. Now, this makes it so i can look around, and works quite well. The problem is that i can not get a full 360 degree view of everything. My view is only limited by how far i can move the mouse. This only lets me see sideways, but not all the way behind me, or straight up or down for that matter. My question is, how can i use the camera, to look all the way behind me and up and down?
Is there a way to re-size an image in processing without it blurring it? I'm too lazy to re-size all my textures in GIMP, and was wondering if there is a way to do this. I want large 8-bit isometric textures, and they are all 16*8 right now, i want them to be 64*32, but still 8-bit.
I am loading a file and checking to see if if the line starts with a #. If it does(just to see that it works) print COMMENT
However on line 10, it throws a Null Pointer Exception. When i test it without using the charAt method of string, it does not have any errors so it would be: if(line == "#"), but that is not what i want.