That one's actually really easy. Simply use an Array or an ArrayList to store the congratulations messages.
Example Code:
ArrayList<String> congratulationsMessages = new ArrayList<String>();...
Type: Posts; User: Gravity Games
That one's actually really easy. Simply use an Array or an ArrayList to store the congratulations messages.
Example Code:
ArrayList<String> congratulationsMessages = new ArrayList<String>();...
I'm currently drawing some of the graphics in my game as 32x32 tiles, but there's a problem. The graphics that are drawn like this sometimes fail to update their position fast enough when the screen...
Though that brings up a new problem, it gives an error when I try to add the object:
ArrayList<extendedobject> objects= new ArrayList<extendedobject>();
Class<?> curclass;
try{...
Alright, but how do I add the object to an Arraylist as opposed to just creating it?
Sorry if I'm just being stupid, but I don't understand what you mean by class definitions. The class I'm trying to load is in the project if that's what you mean. Also, the link you posted links to a...
I googled that package and wasn't able to find what I needed. The closest I found was "getName();", which returns the name of a class as a string. I need to create an object from the class with the...
Well, out of curiosity, is it possible to call a class from the contents of a string.
Here's a psuedo code example of what I mean:
ArrayList <object> objects = new ArrayList <object>();...
*trys commenting out the declaration of the ImageIcons in the Ground object* ...wow I feel stupid...
Well it works now, thanks a lot for being so patient!
When I put a println in the Ground object, it says the value is the second image, however, in the Level.paintComponent method, it says the object in the array has it set to the first image.
Well, what I see is the first image, as well as the black rectangle in the top left. What I should be seeing is the SECOND image in the top left, as well as the black rectangle. I'm trying to...
It will show the problem, its just that the images weren't included. If you put images in the main folder of the .jar with those names, it should show you what I'm talking about...
Yeah, that was testing to make sure that the paintComponent method in the Level class was being called properly. That's not the problem though, the problem is with the Immobileobject and Ground...
Here:
package gravitygamesinteractive.scorpioengine.main;
import javax.swing.*;
import java.awt.*;
public class Frame{
private static final long serialVersionUID=1L;
I've been having a bit of trouble with drawing graphics for an object that extends another object. For whatever reason, the graphics are being shown for the original object, instead of being...
Well, I'm completely stumped. I can't seem to figure out why the variable keeps coming up null. Some of the docs I've read say I need to set up a GraphicsConfigurations object, some say I don't. I've...
Yes, I have read the API doc. The problem still seems to be this line:
if (screen.validate(getGraphicsConfiguration()) == VolatileImage.IMAGE_INCOMPATIBLE){
The screen variable returns as null,...
It should be coming from here:
public Main(){
screen = createVolatileImage(Frame.realsize.width, Frame.realsize.height);
start();
}
...or here...
Lines 32 and 33: if (screen.validate(getGraphicsConfiguration()) ==
VolatileImage.IMAGE_INCOMPATIBLE)
Line 68: renderOffscreen();
EDIT: The screen image is returning as null....
Well, everything seems to be pointing to the "screen" Image, but oddly enough, I set it to a new Volatile Image twice.
Just read the doc here: VolatileImage (Java Platform SE 6)
After trying to tweak my code, I'm still confused, and I'm still getting errors
Code:
package...
Sure, but it's not much:
I'm experimenting with image scaling and volatile images, but whatever I try, I can't seem to get my code to actually draw anything.
Code:
package gravitygamesinteractive.scorpioengine.main;...
Hi, I'm having trouble getting an android app to read from a text file. I tried using the code from my Java project, but apparently that's one of the things that are different in Android Dev...
...
I'm trying to make objects of the same class collide with each other. Unfortunately, they only will collide with the last object created of the class.
Movement Code:
canMove=true;
for(int...
Sorry, I didn't know things like that the little things like that could actually affect the issue...