Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (109)
games submitted by our members
Games in WIP (536)
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]
1  Games Center / Showcase / Fallen Outside on: 2013-04-30 09:13:38
A game I made for the Ludum Dare 26,
You play a character from a video game who has somehow fallen into a different and confusing world. You must travel through the world in order to find your way back home. Collecting the hidden potatoes and visiting simplistic realms along the way.


Play it here:
http://www.ludumdare.com/compo/ludum-dare-26/?action=preview&uid=13768
2  Java Game APIs & Engines / Engines, Libraries and Tools / Slick2D Input from lots of keys on: 2013-03-03 11:08:11
I have noticed, Slick2D will only allow a certain number of keyboard presses at the same time. Is there anyway to change this so i can have up to 6 keys being pressed at the same time
3  Game Development / Game Mechanics / Collision Detection on: 2013-03-02 15:56:36
In my game, entities are rectangles, but are able to rotate, I need a way to tell collision between them taking into account the rotation. I have a double x and y and a double rotation
4  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Slick2D Most efficient way to draw a pixel array on: 2013-03-02 10:35:36
Thanks very much, your method is a lot faster than what I was doing, I am going to look into shaders as they would probably be the most efficient. I still get a bit of lag when alot of the screen has been changed.
5  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Slick2D Most efficient way to draw a pixel array on: 2013-03-02 01:03:06
There isn't actually an image, I'm using it for the background and the cars are leaving tracks in it, so the array is constantly changing
6  Java Game APIs & Engines / Engines, Libraries and Tools / Slick2D Most efficient way to draw a pixel array on: 2013-03-02 00:48:06
I have a int[] cols, and want to draw that in a grid across the screen, I currently have each color fill a 4x4 area, but I want to have it 1 pixel instead of 4. Doing that seems to cause tremendous lag. I am looking for a better way to do this.
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
public void renderTiles(Graphics g, int xScroll, int yScroll, int width, int height){
      for(int x = -1; x < width; x++){
         for(int y = -1; y < height; y++){
            int xt = (x+xScroll/tileSize)%size;
            int yt = (y+yScroll/tileSize)%size;
            if(xt < 0)xt += size;
            if(yt < 0)yt += size;
            g.setColor(new Color(tiles[xt+yt*size]));
            g.fillRect(x*tileSize-xScroll%tileSize, y*tileSize-yScroll%tileSize, tileSize, tileSize);
         }
      }
   }
7  Game Development / Game Mechanics / Re: Rotating A Point on: 2013-03-01 23:43:24
Oh cool thanks, i found a way like this of wikipedia's rotation page, but thanks for the help anyways
8  Game Development / Game Mechanics / Rotating A Point on: 2013-03-01 23:22:41
I am rotating a sprite in game around the center, and need to find out where a certain point is, from the original, so for example in the original a point at (1, 1) on the 64 x 128 image. I need to find that point after the rotation. I am using slick2d as my graphics library
9  Game Development / Newbie & Debugging Questions / Getting Highscores on: 2013-01-28 17:55:52
Hi, I am making a game, and need a simple way to get the highest score, and that player's name. And a way to send data to say there's a new high score. I tried using a simple UDP system but i can't get it to work. I don;t mind running a server, but would prefer not to.
10  Game Development / Game Mechanics / Rendering A Rotatable Globe on: 2012-12-07 17:54:11
I need some help for a project im working on, i want to make a 3D rotating globe, at the moment i am using a pixel array for my rendering, i would like to keep it like that, but i am not sure how to make the 3D globe with a pixel array. My Bitmap class
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
public class Bitmap {

   public final int width;
   public final int height;
   public int[] pixels;

   public Bitmap(int width, int height) {
      this.width = width;
      this.height = height;
      pixels = new int[width * height];
   }


I need some help to make a rendering method for the globe.
11  Game Development / Game Mechanics / Rotating Towards Target on: 2012-11-20 16:35:48
I am having some problems with my method for turning my entity to face another Entity. The angle calculation works perfectly, however the entity will rock back and forth flying away from the target if it is directly below it. I think it is my turning to desired rotation method...
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
MoveOrder mo = (MoveOrder) baseEntity.orders.get(0);
            if(baseEntity.x < mo.x+16 && baseEntity.x > mo.x-16 && baseEntity.y < mo.y+16 && baseEntity.y > mo.y-16)baseEntity.orders.remove(0);
            double xd = mo.x - baseEntity.x;
             double yd = mo.y - baseEntity.y;
             double rotation = Math.toDegrees(Math.atan2(yd,xd))+90;
             while(rotation > 360)rotation -= 360;
             while(rotation < 0)rotation += 360;
             if(baseEntity.rot > rotation+turnSpeed){
                baseEntity.rot -= turnSpeed;
             }else if(baseEntity.rot < rotation - turnSpeed){
                baseEntity.rot += turnSpeed;
             }else{
                baseEntity.rot = rotation;
             }

Could anyone help me sort out how the ships turn to the desired rotation?
12  Games Center / Archived Projects / Re: Space Storm on: 2012-11-19 20:21:18
No problem, first deployment attempt is always troublesome Grin I also downloaded the .exe file, but it also seems to fail silently. Can't really tell what the problem is without logging or exceptions, unfortunately. Has somebody else got it to work?

Oh god, i feel like a failure, i thought it worked. All my friends I've sent it too it seems to work fine, is your computer able to handle 1280x720 resolutions in LWJGL, that's the only difference i could think of, or maybe the antivirus is blocking it, what antivirus are you using?
13  Games Center / Archived Projects / Re: Space Storm on: 2012-11-19 20:07:34
Ok I just looked in C:/Users/<my username> but there's no exe file there. I tried running it using admin rights, but that made no difference either.
It shouldn't need admin rights, i'll add the link to the game.exe itself in the main post, sorry for the hassle...
14  Games Center / Archived Projects / Re: Space Storm on: 2012-11-19 19:57:54
Hey, I tried it but could not get it to work. I get the updater screen with the blog messages, which appears to perform an update. But when I click "Play" the game just drops back to the prompt with no popups or console output.

Looks cool though, I'm curious Grin

I tested this on a Windows 7 machine with Java 7 installed.

I'll look into it, it should then run a different java file i compiled as an exe, if the launcher fails go to C:/Users/USERNAME/game.exe and try running that, it should have downloaded the game there
15  Games Center / Archived Projects / Space Storm on: 2012-11-19 19:25:44

Space Storm is an in development Space Strategy Game by me, I'm 14 and a wannabe game developer, constructive criticism please.
There is a changelog hosted off of tumblr.com you can find here http://spacestormblog.tumblr.com/



I have made a launcher which will automatically update and run the game. You can get it from here, https://dl.dropbox.com/u/63217995/Space%20Storm%20Launcher.jar
If the launcher says updating but then doesn't actually run the game after the updating message has gone, go to C:/Users/USERNAME/game.exe and run that
If there is no file there, use this link for the direct .exe file https://dl.dropbox.com/u/63217995/Space%20Sim%20Game.exe

WINDOWS ONLY FOR NOW, MAC AND LINUX BUILDS COMING SOON

To play, first add at least one enemy and one ally ship, select the one you want to place with left click, place it with right click. Press Space to start, select one of your ships with left click, then right click tells it where to move, the game is won when either team has no ships left, the star wars-esque intro is for the story/campaign I'm planning on adding later!

Please post any bugs/errors that you find Cheesy
16  Game Development / Newbie & Debugging Questions / Rotating Towards Target on: 2012-11-19 19:03:47
I am having some problems with my method for turning my entity to face another Entity. The angle calculation works perfectly, however the entity will rock back and forth flying away from the target if it is directly below it. I think it is my turning to desired rotation method...
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
MoveOrder mo = (MoveOrder) baseEntity.orders.get(0);
            if(baseEntity.x < mo.x+16 && baseEntity.x > mo.x-16 && baseEntity.y < mo.y+16 && baseEntity.y > mo.y-16)baseEntity.orders.remove(0);
            double xd = mo.x - baseEntity.x;
             double yd = mo.y - baseEntity.y;
             double rotation = Math.toDegrees(Math.atan2(yd,xd))+90;
             while(rotation > 360)rotation -= 360;
             while(rotation < 0)rotation += 360;
             if(baseEntity.rot > rotation+turnSpeed){
                baseEntity.rot -= turnSpeed;
             }else if(baseEntity.rot < rotation - turnSpeed){
                baseEntity.rot += turnSpeed;
             }else{
                baseEntity.rot = rotation;
             }

Could anyone help me sort out how the ships turn to the desired rotation?
17  Game Development / Newbie & Debugging Questions / Re: Rendering font with LWJGL on: 2012-11-02 17:05:31
Texcoords are in the range 0..1 Pointing

Thanks, completely forgot that, fixed it now
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
   public static void draw(String string, int x, int y, float r, float g, float b, float a) {
      for (int i = 0; i < string.length(); i++) {
         int ch = chars.indexOf(string.charAt(i));
         if (ch < 0) continue;

         int xx = (ch % 10) * 12;
         int yy = (ch / 10) * 16;
         int xd = x + i * 12;
           GL11.glPushMatrix();
         GL11.glColor4f(r, g, b, a);
         TextureHandler.font.bind();
           GL11.glBegin(GL11.GL_QUADS);
           float left = (float) (1.0*(xx/128.0));
           float right = (float) (1.0*((xx+10)/128.0));
           float top = (float) (1.0*(yy/128.0));
           float bottom = (float) (1.0*((yy+16)/128.0));
           GL11.glTexCoord2f(left, top); GL11.glVertex2f(xd, y);
           GL11.glTexCoord2f(right, top); GL11.glVertex2f(xd+10, y);
           GL11.glTexCoord2f(right, bottom); GL11.glVertex2f(xd+10, y+16);
           GL11.glTexCoord2f(left, bottom); GL11.glVertex2f(xd, y+16);
           GL11.glEnd();
           GL11.glPopMatrix();
      }
   }
18  Game Development / Newbie & Debugging Questions / [SOLVED]Rendering font with LWJGL on: 2012-11-02 16:34:12
I am having some trouble rendering fonts with LWJGL, i have a 128x128 png with all the letters drawn out, my current code is
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  
package com.bomberBox.game.screen;

import org.lwjgl.opengl.GL11;

import com.bomberBox.game.TextureHandler;

public class Font {
   private static final String chars = "" + //
        "ABCDEFGHIJ" +//
        "KLMNOPQRST" +//
        "UVWXYZabcd" +//
        "efghijklmn" +//
        "opqrstuvwx" +//
        "yz/#:     " +//
        "0123456789";


   
   public static void draw(String string, int x, int y, float r, float g, float b, float a) {
      for (int i = 0; i < string.length(); i++) {
         int ch = chars.indexOf(string.charAt(i));
         if (ch < 0) continue;

         int xx = (ch % 10) * 12;
         int yy = (ch / 10) * 16;
         int xd = x + i * 12;
           GL11.glPushMatrix();
         GL11.glColor4f(r, g, b, a);
         TextureHandler.font.bind();
           GL11.glBegin(GL11.GL_QUADS);
           GL11.glTexCoord2f(xx, yy); GL11.glVertex2f(xd, y);
           GL11.glTexCoord2f(xx + 10, yy); GL11.glVertex2f(xd+20, y);
           GL11.glTexCoord2f(xx + 10, yy + 16); GL11.glVertex2f(xd+20, y+32);
           GL11.glTexCoord2f(xx, yy + 16); GL11.glVertex2f(xd, y+32);
           GL11.glEnd();
           GL11.glPopMatrix();
      }
   }
}


It renders some white bars but not the font or words... I am struggling to see where i've gone wrong...
19  Game Development / Game Mechanics / Re: Calculating angle to mouse on: 2012-10-30 21:37:33
Thanks! Got it to work,
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
double movementAngle = Math.toRadians(rot);
        x += Math.sin(movementAngle) * 0.5;
        y -= Math.cos(movementAngle) * 0.5;
        if(orders.size() > 0){
           if(orders.get(0) instanceof MoveOrder){
              MoveOrder mo = (MoveOrder)orders.get(0);
              double xd = mo.x - x;
              double yd = mo.y - y;
              double rotation = Math.toDegrees(Math.atan2(yd,xd))+90;
              rot = rotation;
              orders.remove(0);
           }
        }


1  
2  
        float angle = (float) (rot % 360.0f);
        GL11.glRotated(angle+180.0f, 0, 0, 1);
20  Game Development / Game Mechanics / Re: Calculating angle to mouse on: 2012-10-30 21:07:51
Okay, i've done some testing, and it seems to work fine x Axis, but messes up somewhere on the y Axis, as in, if i tell it to go from (0,0) to (10,0) it works fine, if i want to move just in the x Axis it has to be
1  
2  
3  
4  
MoveOrder mo = (MoveOrder)orders.get(0);
              double xd = mo.x - x;
              double yd = mo.y - y;
              double rotation = Math.toDegrees(Math.atan2(yd,xd))+90;


However, if i want to move in the y Axis it has to be
1  
2  
3  
4  
MoveOrder mo = (MoveOrder)orders.get(0);
              double xd = mo.x - x;
              double yd = mo.y - y;
              double rotation = Math.toDegrees(Math.atan2(yd,xd))+270;

Which even further confuses me...

I've got it to move in the right direction by doing it like this
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
double movementAngleX = Math.toRadians(rot);
      double movementAngleY = Math.toRadians(rot+180);
        x += Math.sin(movementAngleX) * 0.5;
        y += Math.cos(movementAngleY) * 0.5;
        if(orders.size() > 0){
           if(orders.get(0) instanceof MoveOrder){
              MoveOrder mo = (MoveOrder)orders.get(0);
              double xd = mo.x - x;
              double yd = mo.y - y;
              double rotation = Math.toDegrees(Math.atan2(yd,xd))+90;
              rot = rotation;
              System.out.println(rot);
              orders.remove(0);
           }
        }

But then the rotation on the image is messed up, the rendering code is (im using LWJGL)
1  
2  
3  
4  
5  
6  
7  
8  
9  
        
        GL11.glTranslated(x+32, y+32, 0);
        GL11.glRotated(rot, 0, 0, -1);
        GL11.glBegin(GL11.GL_QUADS);
        GL11.glTexCoord2f(0.0f, 0.0f); GL11.glVertex2f(-32, -32);
        GL11.glTexCoord2f(1.0f, 0.0f); GL11.glVertex2f(32, -32);
        GL11.glTexCoord2f(1.0f, 1.0f); GL11.glVertex2f(32, 32);
        GL11.glTexCoord2f(0.0f, 1.0f); GL11.glVertex2f(-32, 32);
        GL11.glEnd();

Anyone got any ideas?
21  Game Development / Game Mechanics / Re: Calculating angle to mouse on: 2012-10-30 19:29:54
It seems to go in completely random directions, and doesn't move to the mouse at all...
22  Game Development / Game Mechanics / [SOLVED] Calculating angle to mouse on: 2012-10-30 15:47:01
I need help calculating the angle to the mouse from entities,
1  
2  
3  
4  
5  
6  
7  
8  
9  
if(orders.get(0) instanceof MoveOrder){
              MoveOrder mo = (MoveOrder)orders.get(0);
              double xd = mo.x - x;
              double yd = mo.y - y;
              double rotation = Math.toDegrees(Math.atan2(yd,xd))+270;
              rot = rotation;
              System.out.println(rot);
              orders.remove(0);
           }


This is my current code, but it doesn't seem to work, and the movement code is:
1  
2  
3  
4  
5  
while(rot > 360)rot-= 360;
      while(rot < 0)rot+= 360;
      double movementAngle = Math.toRadians(rot);
        x += Math.sin(movementAngle) * 0.5;
        y += Math.cos(movementAngle) * 0.5;


can anyone help?
Pages: [1]
 

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

The first screenshot will be displayed as a thumbnail.

CogWheelz (18 views)
2014-07-30 21:08:39

Riven (25 views)
2014-07-29 18:09:19

Riven (15 views)
2014-07-29 18:08:52

Dwinin (12 views)
2014-07-29 10:59:34

E.R. Fleming (33 views)
2014-07-29 03:07:13

E.R. Fleming (12 views)
2014-07-29 03:06:25

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

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

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

Riven (31 views)
2014-07-23 20:56:16
List of Learning Resources
by SilverTiger
2014-07-31 18:29:50

List of Learning Resources
by SilverTiger
2014-07-31 18:26:06

List of Learning Resources
by SilverTiger
2014-07-31 13:54:12

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
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!