Hi, I'm making a test program for resource loading inside a jar and I'm having problems.
I've read that you should use ClassLoader or alternatively getClass() to access a file inside a jar. Since...
Type: Posts; User: Dr.Code
Hi, I'm making a test program for resource loading inside a jar and I'm having problems.
I've read that you should use ClassLoader or alternatively getClass() to access a file inside a jar. Since...
The instructions say that all the data members (except height, weight, age and BMI) should be defined when the class is instantiated. A class is instantiated when the constructor is called. Therefor...
Thank you all for the answers :)!
Hi everybody!
Please don't be mad because of this article. Im writing this because I have a school project, well, its an investigation really. We have been assigned to investigate anything about...
Hi!
I have picked out some code snippets that could cause the problem. The first example is the drawing code of my main JPanel. This is were my buffering takes place.
@Override
public...
Hi!
Im currently making a game with a rpg tile-based world. The problem is that the world gets "cracks" as if it flickers. I have never encountered this problem before and have no idea what it is....
Your problem is that the log variable is created inside the main(String[] args) method. You have to create this object outside the method but inside the class.
public class Main {
final...
I am still pretty sure that the error is in the canBeAt() method in the first post!
SOMEBODY PLEASE HIT ME IN THE HEAD! I have been wrong all along! the look-up Tile array is [y-axis][x-axis] not [x-axis][y-axis]! OMG! But that is easily fixed with a little tweaking on the...
I just realized it do not! The x axis is moved forward 3 stepes(where i should get the value 3 i get 0) and the y axis is moved back 2 stepes (where I should get 0 i get 2) I will look further in the...
The problem is "street/n" as well as "town/n" it should be "street\n" and "town\n"! That's why you don't get any spacing!
Im sorry if my message was unclear! I will edit it now!
Im sorry but I am not familiar enough with the java language to answer your questions, however I do now that there is a Thread.interrupted() method that returns true if the currently executing thread...
Hi, I'm making a simple game, but I have problems with my collision detection! My world is based on tiles with currently four different types: FLOOR, WALL, VOID and PIT.
You shouldn't be able to...
You're error is as you said the myCoin.flip. You have to put myCoin.flip() and also change the flip method return type to double.
for(int flips = 0; flips < 1000; flips++)
{
if...
You were right again apparently I had put the setSize() method after i called the initAndStart() method. Thank you very much!
You're right apparently the world.length variable = 0. But i have no idea why. world is a Block[][]
defined in the constructor like this:
public World(Dimension par0Dimension) {
size =...
Hi, I'm making a game with random world generation. Everything is running smothly except when it comes down to drawing the blocks on screen. It has a for loop to loop through all the different blocks...
Thank you! it worked!
Hi! (Sorry for the bad title. English is not my native language and I didn't know how to put it.) I have a problem with getting an image with ImageIO.read(File file). I have the following code to get...
I'm not sure, but I think it should be <applet code="FirstApplet.class" width='300' height='300'>, not
<applet code="FirstApplet" width='300' height='300'>.
I'm not very good with Applets but...
LOL! I'm so stupid...
Thx man!
Right, here's the code:
package trust.src;
import java.awt.List;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
Wait, solved it, I should use Math.atan instead of tan and then convert the radians i get from that to degrees. And I get the correct output.
Here's my final code:
import java.util.Scanner;...
Well what I'm trying to do is to calculate an angle with only knowing the abutting catheter and the adjacent side.
I do not know how to do that. I think it is something with arctan(Math.atan()), but...