Search:

Type: Posts; User: Gravity Games

Page 1 of 7 1 2 3 4

Search: Search took 0.29 seconds.

  1. Replies
    2
    Views
    400

    Re: Vacation Switch

    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>();...
  2. Making a Graphics Drawing Loop More Efficient

    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...
  3. Replies
    9
    Views
    360

    Re: Calling a Class Name from a String?

    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{...
  4. Replies
    9
    Views
    360

    Re: Calling a Class Name from a String?

    Alright, but how do I add the object to an Arraylist as opposed to just creating it?
  5. Replies
    9
    Views
    360

    Re: Calling a Class Name from a String?

    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...
  6. Replies
    9
    Views
    360

    Re: Calling a Class Name from a String?

    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...
  7. Replies
    9
    Views
    360

    Calling a Class Name from a String?

    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>();...
  8. Re: Problems With Image Loading and Extended Objects

    *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!
  9. Re: Problems With Image Loading and Extended Objects

    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.
  10. Re: Problems With Image Loading and Extended Objects

    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...
  11. Re: Problems With Image Loading and Extended Objects

    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...
  12. Re: Problems With Image Loading and Extended Objects

    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...
  13. Re: Problems With Image Loading and Extended Objects

    Here:

    package gravitygamesinteractive.scorpioengine.main;


    import javax.swing.*;
    import java.awt.*;

    public class Frame{
    private static final long serialVersionUID=1L;
  14. Problems With Image Loading and Extended Objects

    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...
  15. Re: Need Help with Rendering the screen (with volatile images)

    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...
  16. Re: Need Help with Rendering the screen (with volatile images)

    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,...
  17. Re: Need Help with Rendering the screen (with volatile images)

    It should be coming from here:


    public Main(){
    screen = createVolatileImage(Frame.realsize.width, Frame.realsize.height);
    start();
    }

    ...or here...
  18. Re: Need Help with Rendering the screen (with volatile images)

    Lines 32 and 33: if (screen.validate(getGraphicsConfiguration()) ==
    VolatileImage.IMAGE_INCOMPATIBLE)

    Line 68: renderOffscreen();

    EDIT: The screen image is returning as null....
  19. Re: Need Help with Rendering the screen (with volatile images)

    Well, everything seems to be pointing to the "screen" Image, but oddly enough, I set it to a new Volatile Image twice.
  20. Re: Need Help with Rendering the screen (with volatile images)

    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...
  21. Re: Need Help with Rendering the screen (with volatile images)

    Sure, but it's not much:
  22. Need Help with Rendering the screen (with volatile images)

    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;...
  23. Trouble Porting my Java File Reading Code to Android Code

    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...
    ...
  24. Replies
    1
    Views
    360

    Trouble with Object Collision

    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...
  25. Replies
    12
    Views
    623

    Re: Drawing many Tiles on screen

    Sorry, I didn't know things like that the little things like that could actually affect the issue...
Results 1 to 25 of 152
Page 1 of 7 1 2 3 4