Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (533)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1] 2 3 4
1  Games Center / WIP games, tools & toy projects / Re: Prophour23 - a fast-paced, randomized RTS on: 2014-07-24 17:14:21
When will the demo be avalable if you plan a demo?
2  Game Development / Newbie & Debugging Questions / Re: My game gives me a white screen when I run it with tiles moving enabled on: 2014-07-22 17:50:39
Maybe it's moving to fast and you don't see it, try moving it just 10 pixels and stop!
3  Java Game APIs & Engines / Engines, Libraries and Tools / Re: [Lego NXT] Java Libs? on: 2014-07-22 17:40:46
And i found it, Java for your robot Cheesy. Sorry for me saying no to java but i found it! Hope i helped! Cheesy
4  Java Game APIs & Engines / Engines, Libraries and Tools / Re: [Lego NXT] Java Libs? on: 2014-07-22 17:37:32
Rasberry Pi can use java but are you aming for? And how do you think to make your robots? Just wondering.

Edit: There is a link on the bottom of the page Software Dev. Kit and Hardware  Dev. Kit check them out there are no details on the page
5  Java Game APIs & Engines / Engines, Libraries and Tools / Re: [Lego NXT] Java Libs? on: 2014-07-22 17:32:58
There is a download link for the software in the link you posted! xD I dont think it can be programed in java, you have to use that software! It would be cool if you can program it but it has it's own OS-thing that controls it!
6  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-07-22 00:43:21
I am making my character design here is the sketch doing pixel art later :


7  Game Development / Newbie & Debugging Questions / Re: Why does my if statments stop working when I remove System.out statments on: 2014-07-22 00:26:59
try playerHealth < 1 !
8  Game Development / Newbie & Debugging Questions / Re: Why does my if statments stop working when I remove System.out statments on: 2014-07-21 22:57:54
What do you have in gameOver(); ?
9  Game Development / Newbie & Debugging Questions / Re: My bullet(missile,magic) doesn't want to go to mouse x,y!? on: 2014-07-19 16:05:38


Yea it works xD i Just made new x,y floats and and works sometimes i just don't understand computer/java thanks everybody:D
10  Game Development / Newbie & Debugging Questions / Re: My bullet(missile,magic) doesn't want to go to mouse x,y!? on: 2014-07-19 15:41:26
Ok weard stuff is going on xD
11  Game Development / Newbie & Debugging Questions / Re: My bullet(missile,magic) doesn't want to go to mouse x,y!? on: 2014-07-19 15:24:30
Then how can i make it not snapp to 15 degrees?
12  Game Development / Newbie & Debugging Questions / Re: My bullet(missile,magic) doesn't want to go to mouse x,y!? on: 2014-07-19 14:50:25
I use the code like NegativeZero said but i get the effect shown on the screen and i want it to go in a straight line, i tried with vec2 same effect,Is it possible or should I leave it as it is?
http://www.mediafire.com/download/sunoh7d6ctwalf1/game.jar
here you can see what is happening!
13  Game Development / Newbie & Debugging Questions / Re: My bullet(missile,magic) doesn't want to go to mouse x,y!? on: 2014-07-19 11:45:52
And from that how can i calculate the velocity for x,y?
14  Game Development / Newbie & Debugging Questions / My bullet(missile,magic) doesn't want to go to mouse x,y!? [solved] on: 2014-07-19 11:07:13
I asked this question before but i had particles on my missile and i thougth that it was working, and it's not!   Emo

Well i get this:

before i changed static x,y to not static:



after:




GitHub for the code
Look in the src/Entity for the player(shooting from the player)
and missile, camera is in the control


I don't know why is it doing this? I want it to go at any angle! Why it doesn't ?
15  Game Development / Newbie & Debugging Questions / Re: How to reset the game ? on: 2014-07-19 10:57:21
well you need to reset everything score player .............
just when you do like
1  
player = new Player(....);

just repeat that! And reset score,lives ....... You don't need to create a new window!
I hope i helped!
16  Game Development / Newbie & Debugging Questions / Re: Get the mouse x , y? [solved or not?] on: 2014-07-17 23:42:46
 Emo Well you helped but the code is still not working
i still get chunks


Source on GitHub
17  Game Development / Newbie & Debugging Questions / How to load an image from a jar? [solved] on: 2014-07-17 15:52:42
my code:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
   public static BufferedImage grabImage(String path, int x, int y, int width, int height) {
      BufferedImage tile = null;
      BufferedImage bildTileset = null;
      try {
         bildTileset = ImageIO.read(new File(path));
      } catch (IOException error) {
         System.err.println("Tileset not found");
         error.printStackTrace();
      }
      tile = bildTileset.getSubimage(x * width, y * height, width, height);
      return tile;
   }

//exapmple
// BufferedImage img = grabImage("res/img/img.png",0,0,16,16);

But it wont work! It loads if it is outside of the jar! How do i load it form inside the jar?
18  Game Development / Newbie & Debugging Questions / Re: Get the mouse x , y? on: 2014-07-17 01:01:04
It's not solved Sad!
19  Game Development / Newbie & Debugging Questions / Re: Animating on: 2014-07-17 00:50:49
I don't reconend doing that, it would be a painfull process! Try just clear java animation. This is how i do it :
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
package Graphics;

import java.awt.image.BufferedImage;

import Main.Main;

public class Animation {

   private BufferedImage[] animImages = {};
   private boolean animate = false;
   private int index = 0;
   private long miliSeconds, targetTime, now;

   public Animation(int mili,BufferedImage[] images) {
      this.miliSeconds = mili;
      animImages = images;
      now = System.currentTimeMillis();
      targetTime = now + miliSeconds;
      Main.anims.add(this);
   }
   
   public void stopAnimation(){
      animate = false;
   }
   
   public void startAnimation(){
      animate = true;
   }
   
   public BufferedImage getCurrentImage(){
      if(index < 0 || index > animImages.length){
         new Exception();
      }
      return animImages[index];
   }
   
   public void disposeAnimation(){
      Main.anims.remove(this);
   }
   
   public void setIndex(int i){
      index = i;
   }
   
   public void tick(){
      if (System.currentTimeMillis() >= targetTime && animate) {
         index++;
         now = System.currentTimeMillis();
         targetTime = now + miliSeconds;
         if(index>animImages.length-1){
            index = 0;
         }
      }
   }

}


Make an a static array list in the main method and tick every animation in there it so easy to get the image getCurrentImage() simple as that!
20  Game Development / Newbie & Debugging Questions / Re: Get the mouse x , y? on: 2014-07-16 13:50:14
Thank you! But why is it doing that?
21  Game Development / Newbie & Debugging Questions / Re: Get the mouse x , y? on: 2014-07-16 13:45:02
The Entity ? :
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
package Entity;

import java.awt.Graphics2D;
import java.awt.Rectangle;

public class Entity extends Rectangle{
   
   public static double x,y;
   public double drawX;
   public double drawY;
   public int width,height;
   
   public Entity(int x,int y, int width,int height){
      this.x = x;
      this.y = y;
      this.width = width;
      this.height = height;
   }
   
   public void setX(int x){
      this.x = x;
   }
   
   public void setY(int y){
      this.y = y;
   }
   
   public void setWidth(int width){
      this.width = width;
   }
   
   public void setHeight(int height){
      this.height = height;
   }
   
   public void tick(){
     
   }
   
   public void render(Graphics2D g){
     
   }
}
22  Game Development / Newbie & Debugging Questions / Re: Get the mouse x , y? on: 2014-07-16 13:28:18
I have posted everything now!
23  Game Development / Newbie & Debugging Questions / Get the mouse x , y? NOT SOLVED on: 2014-07-16 12:54:15
Well i get this:
(before i changed static x,y to not static)

(after)


GitHub for the code

i dont know why is it doing this? I want it to go at any angle? why it doesn't ?

Edit: Everything !
24  Games Center / WIP games, tools & toy projects / Re: [Slick2D] JavaRA - Command&Conquer: Red Alert with taste of Java on: 2014-07-16 11:23:53
I love it! I when i was younger i played Red Alert 2 a lot, this reminds me of the fun i had!
25  Game Development / Newbie & Debugging Questions / Re: Did you know? Hints and tips on: 2014-07-14 23:43:27
Some tips and tricks
http://www.alethis.net/reference/java/java.html
26  Game Development / Game Mechanics / Re: LWJGL Best way to handle 2D Sprite Animations? on: 2014-07-14 23:35:09
This is how i do it, no LWJGL!

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
import java.awt.image.BufferedImage;

public class Animation {

   private BufferedImage[] animImages = {};
   private boolean animate = false;
   private int index = 0;
   private long miliSeconds, targetTime, now;

   public Animation(int mili,BufferedImage[] images) {
      this.miliSeconds = mili;
      animImages = images;
      now = System.currentTimeMillis();
      targetTime = now + miliSeconds;
      Main.anims.add(this);
   }
   
   public void stopAnimation(){
      animate = false;
   }
   
   public void startAnimation(){
      animate = true;
   }
   
   public BufferedImage getCurrentImage(){
      if(index < 0 || index > animImages.length){
         new Exception();
      }
      return animImages[index];
   }
   
   public void disposeAnimation(){
      Main.anims.remove(this);
   }
   
   public void setIndex(int i){
      index = i;
   }
   
   public void tick(){
      if (System.currentTimeMillis() >= targetTime && animate) {
         index++;
         now = System.currentTimeMillis();
         targetTime = now + miliSeconds;
         if(index>animImages.length-1){
            index = 0;
         }
      }
   }

}
27  Game Development / Game Mechanics / Colision! How the fuq? [solved] on: 2014-07-14 23:26:30
I have no idea of doing it!
in the begining of the tick method in the player i set xPrev and yPrev to x,y.
Then i do the moving... If intersects then i set x,y to xPrev and yPrev. I get stuck in one place pls help!
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
public void move() {
      xPrev = x;
      yPrev = y;
      if (Controler.up) {
         y -= Game.pSpeed;
         dir = 1;
         animUp.startAnimation();
      }
      if (Controler.down) {
         y += Game.pSpeed;
         dir = 0;
         animDown.startAnimation();
      }
      if (Controler.left) {
         x -= Game.pSpeed;
         dir = 3;
         animLeft.startAnimation();
      }
      if (Controler.right) {
         x += Game.pSpeed;
         dir = 2;
         animRight.startAnimation();
      }
      colDect();
   }

   private void colDect() {
      for (int i = 0; i < world.tiles.length; i++) {
         for (int j = 0; j < world.tiles[0].length; j++) {
            if (colBox.intersects(world.tiles[i][j]) && world.tiles[i][j].solid) {
               x =  xPrev;
               y = yPrev;
            }
         }
      }
   }

Edit:
What i did is that i moved the collision box first and checked if the is a collision if it was colliding i wouldn't move! But i get it so that my player can't move if i go left and up and there is collision up!For now it's good i guess!
28  Game Development / Newbie & Debugging Questions / Re: ArrayIndexOutOfBounds WTF? on: 2014-07-14 20:44:58
Ok thanks! xD
29  Game Development / Newbie & Debugging Questions / Re: ArrayIndexOutOfBounds WTF? on: 2014-07-14 20:40:18
Yea my mistake copying it it's lenght there! Not working!
30  Game Development / Newbie & Debugging Questions / ArrayIndexOutOfBounds WTF? on: 2014-07-14 20:35:18
My code:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
   int worldSize = 64;
   private Tile[][] tiles = new Tile[worldSize][worldSize];

   public World() {
      for (int i = 0; i < tiles.lenght; i++) {
         for (int j = 0; i < tiles[0].lenght;j++) {
            tiles[i][j] = new Grass(i * 64, j * 64); // Exception!
        }
      }
   }


The exception:

1  
2  
3  
4  
5  
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 64
   at World.World.<init>(World.java:13)
   at Main.Game.<init>(Game.java:27)
   at Main.Main.<init>(Main.java:48)
   at Main.Main.main(Main.java:153)


Why is this happening, it's not the first time and i dont know why!? Help?

Edit: Not working with lenght!
Pages: [1] 2 3 4
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

pw (24 views)
2014-07-24 01:59:36

Riven (24 views)
2014-07-23 21:16:32

Riven (18 views)
2014-07-23 21:07:15

Riven (21 views)
2014-07-23 20:56:16

ctomni231 (50 views)
2014-07-18 06:55:21

Zero Volt (45 views)
2014-07-17 23:47:54

danieldean (36 views)
2014-07-17 23:41:23

MustardPeter (39 views)
2014-07-16 23:30:00

Cero (55 views)
2014-07-16 00:42:17

Riven (55 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!