No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
10 Posted Topics
I'm trying to make a class called "Sprite", which is supposed to handle spritecards and such. However, I can't seem to be able to get the image height without having an image observer object. Do I have to pass the image observer from the main class to every sprite class … | |
[B]This has been solved! Look at the end of this post.[/B] Hello! I'm having some trouble here with polymorphism, as I need to access methods in a subclass from an array of superclass objects. This method is called parseCommand(Command c); The method exists in the superclass and is overridden in … | |
Hello! I am currently working on a project with a few others. Everything has went on smoothly until now. When I run the project in NetBeans, everything is working as intended. All images show up like they should. If I start the jar file with the console commands (java -jar … | |
I'm using the drawImage(); method in Graphics2D to draw my png images. However, I'd like to be able to render them with screen blending. If it's possible, I'd really like to know how you do it, and if it's fast enough to be used real-time in games. I think I'm … | |
I have a Player class, a Weapon class and a Projectile class in my applet game. The weapon class uses Projectile objects when fired. For example, everytime I click I want this code to execute: [CODE]projectileList.add( player.weapon.fire() );[/CODE] player.weapon.fire() returns one or more projectiles that the projectileList handles every frame. … | |
For example: [CODE]package topdowngame; public class SpeedDir { double speed; private double direction; static final SpeedDir INTERNAL = new SpeedDir(1,45); // Other stuff [/CODE] If I write a code like this and excute it when I click: [CODE]player.speedDir = SpeedDir.INTERNAL;[/CODE] It only works the first time I click. I have … | |
I am currently writing a weapon class and a projectile class, to use in a top-down game. However, I can't seem to be able to load images in a class. It works in the main function, where I do it like this: [CODE]Image bulletImage =getImage(getCodeBase(),"bullet_machinegun.png");[/CODE] However, this doesn't work inside … | |
I'm making a Java applet that's a 2D platform game. Each map contains (So far) only collision lines, a background and a foreground image. The collision lines are used for collision detection with pretty much everything that collides with the terrain. For you guys to be able you help, I … | |
After I've been running my program for a while, it freezes and gives me this error in the console: [COLOR="Red"]Exception in thread "Thread-4" java.lang.IllegalArgumentException: timeout value is negative at java.lang.Thread.sleep(Native Method)[/COLOR] It gives me a line to where the error occurs, which is the same line where it says "try": … | |
I don't get where to insert the code and such; I could really use some help with this. :) Here's my java file: (I removed irrelevant stuff) [code=java] package projectprojectile; import java.applet.*; import java.awt.*; import java.io.File; import java.util.Calendar; import java.util.LinkedList; import java.util.List; import javax.swing.JOptionPane; public class Main extends Applet implements … |
The End.