Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (582)
Games in Android Showcase (163)
games submitted by our members
Games in WIP (633)
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
1  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-05-04 01:07:22

I have no idea if I can actually use FB photos like this.

I made a Spinner widget! Because I was afraid of Swing and whatever AWT uses! I made my own! I also make many other things, like poor decisions!
2  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-04-19 21:31:22
Figured out how to change mouse sensitivity from within the game yesterday. It required grabbing/hiding the native cursor and replacing it with my own, so now I have a hilariously misleading placeholder! But you can control the cursor with a controller now if you want. :O
3  Java Game APIs & Engines / OpenGL Development / Re: LWJGL 3; how's it getting along? on: 2014-12-08 00:21:09

My game is only 2d, and I'm targeting very broad, very old specs. I have, for example, a computer from 2009(!) that only supports OGL 1.4 apparently. Though I'm just going for 2.1 or something so I can use fragment shaders, unless I have it in me to try and mess with extensions to get those working on 1.4, too.

Would I benefit at all from moving to the new LWJGL?
4  Java Game APIs & Engines / OpenGL Development / Re: LWJGL 3; how's it getting along? on: 2014-12-07 17:51:10
Pardon me if this has already been asked, but how does one access the old javadocs? For example, I had this page open, but it has since become a 404:
5  Discussions / Miscellaneous Topics / Re: A rant on OpenGL's future on: 2014-08-14 12:04:17
I dunnno about that... maybe I'm nuts, but it seems like things have been shifting away from custom rigs. Or maybe that's always been a niche thing, and the niche is swelling along with the overall amount of computer users? But if people start moving away from desktops and laptops... hm.
6  Discussions / Miscellaneous Topics / Re: A rant on OpenGL's future on: 2014-08-14 01:56:43
I have a 2009 computer with an integrated Intel card that may or may not even support fragment shaders. (It's whatever version supports it using an extension. 1.3? 1.4?) It's depressing, but still makes me counterproductively determined to make the game run on it anyway.
7  Game Development / Newbie & Debugging Questions / Re: [Game] How do i make a camera.class? on: 2014-07-27 23:05:22
Glad to help!

I'll let someone else answer your latest question though. Since you're asking multiple questions on one thread, try editing/modifying your original post so you can change the title to reflect your current problem. That way, people know to stop by if they think they can help.

And you can always Appreciate my posts to get me imaginary medals if they've been helpful. Wink
8  Game Development / Newbie & Debugging Questions / Re: [Game] How do i make a camera.class? on: 2014-07-27 21:15:29
I did something similar with my tile grid. (I have the map as a single image, but a bunch of grid outlines placed over it that slowed things down on large maps.)

You need to, before drawing each tile (either in renderMap() or in Tile.render()), calculate whether the tile is on the screen and only draw it if it is.

The information you need:
1. The tile's sides (the x of the left and of the right, the y of the top and of the bottom) or the x,y of a corner and the width and height for you to calculate this from.
2. The width and height of the draw area. I.e., if your window is 1200x800, this might be something like 1192x780. The space that graphics go. This is the cnvW and cnvH (from GameBase.getCnvW() and getCnvH()) in the Camera code I gave you, but you may have it labeled something different or may need to calculate it still by subtracting the frame from the window or something.
3. The position of the Camera. In the Camera code I gave you, I think it's the Camera.getX() and Camera.getY() that give you the top-left corner of the area you want to draw (i.e. the camera location).

Using that, can you figure out how to tell if a Tile is at least partially on-screen before bothering to draw it?
9  Game Development / Newbie & Debugging Questions / Re: [Game] How do i make a camera.class? on: 2014-07-27 19:39:29
Glad to hear you got it working! So, if you centerOnCharacter(), it snaps the camera over to the Player you specify then? Obviously, you had to do a bit of converting to make it work with your classes.

For updating the screen, here's the approach I took:
1. Every time we are ready to update the screen, loop through all things that should be drawn and call their draw() methods.
2. In a draw() method, you do the work of picking the right image and drawing it. I believe you already do this.
3. When everything has drawn, flip the buffer strategy or whatever it is you need to do to put the new drawing on the screen.

For individual animations, here's the approach I took:
1. I made an Animation class.
2. Each thing that should draw has at least one instance of the animation class. Tiles would usually only need one, Players will need one for each pose and direction combination they can have (for example, walking west, idling facing north).
3. When a thing draws, it checks which animation it is currently using (which can be changed when, for example, a Player turns to a different direction or changes poses)...
4. ...then, it tells that animation to draw its next frame, giving it the x and y location minus the Camera's x and y. The animation grabs a BufferedImage, which it then draws.
5. This brings us to Animations themselves:
5a. An animation needs to know several things. First, which images it needs to use (or which directory to automatically load them from).
5b. It needs to know how many frames per second to play and whether it should go back to the first frame when it's finished and loop around, or if it should stay at the last frame when it's done.
5c. If you're allowing the players to pause, it needs to keep track of when it was last paused, last resumed, and be able to take that into account to avoid skipping frames, because...
5d. needs to keep track of when it handed over the last frame to be drawn and what number that frame was...
5e. it can decide what frame to give you when you ask it for the nextFrame(). It compares the current time, the lastFrameTime, and playRate to decide whether to give you the last frame again or move on to the next one. If it's time for a new frame, it needs to make sure that it either loops back to the beginning or gives you the final frame again if it's at the final frame, depending on whether it is a looping animation or not.

I've found this to be a pretty convenient way of doing things, once I got it working.
10  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-07-27 17:37:48
Today (and yesterday), I implemented controller support. A lot of copy-pasting and renaming of copied variables and methods. But now, you should theoretically be able to remap controller buttons and axes just like you can keyboard and mouse buttons, and it should process any input you do correctly.

Not that I've tested it yet. Would anybody find this sort of system for remappable keys, mice, and controller stuff useful?

Screenshots would not be terribly interesting. D:
11  Java Game APIs & Engines / OpenGL Development / Re: LWJGL Controller Advice [Getting false axis events] on: 2014-07-27 13:42:24
Thanks. It hands me events separately for horizontal and vertical movement, and I can compute the angle from those.

The events, as far as I can tell, only trigger when a stick position changes. The right stick gets labeled by LWGLJ as "X Rotation" and "Y Rotation", depending on which direction you push it. If you push it straight to the right, for example, it triggers an X Rotation event with a value of 1.0. All the way to the left is -1.0. If you were to push it, say, to the right and a little bit down, it would give a pair of events, something like X Rotation 1.0 and Y Rotation 0.4253412. And, if you let go of the stick, it fires an event for each axis with values of 0.0. So, on this controller at least, 0.0 is centered. You can set a dead zone where it's not supposed to notice little changes, if I understand correctly.

The weird thing is that, for any other stick movements, it only fires the event once each time you move. It doesn't keep creating events if you hold it still. Yet, the "X Rotation" axis (left-right on the right stick) keeps firing a 0.0 event. It looks as if the computer thinks that the stick keeps getting moved to the center from somewhere else, over and over again, instead of just staying there.
12  Java Game APIs & Engines / OpenGL Development / Re: LWJGL Controller Advice [Getting false axis events] on: 2014-07-27 03:09:08
Current problem, for those interested in helping, or for posterity:

The "X Rotation" axis (moving the right stick side-to-side on the Xbox 360 controller I'm using) is giving constant false positives. I keep getting events where the x- and y-axis values for the event are both 0.0, it's an axis event, and the axis name is "X Rotation". This regardless of what I set the RXDeadZone to (the default is 0.05, I think).

I guess I'll just ignore them for now, as they seem to be doing no real harm?

If anyone knows what's up here, I'd appreciate any advice.
13  Game Development / Newbie & Debugging Questions / Re: [Game] How do i make a camera.class? on: 2014-07-27 01:22:14
Take a look when you've had some sleep; I think you might be able to figure it out. Sorry I won't be analyzing your code or game, but here are some hints on the camera:

The Camera represents where the person who is playing the game is. When that person moves, the things in the game world don't. When the things in the game world move, the person playing does not. But, when you move, it looks like everything else does, because they are being "drawn" through your eyes and in your brain based both on where they are and where you are. So, when we draw something in the game, we should draw it based both on where it is and where the human player is. Thus, g.drawImage(cheapAnimation(), x - Camera.getX(), y - Camera.getY(), width, height, null); . The x and y are where the thing is, and the Camera.getX() and Camera.getY() are where the human player is looking from.

Your Tile.render() should draw its image with its x and y minus the Camera's x and y. This way, if the camera moves to the right, the level gets drawn to the left, for example, making it look like your view has moved to the right.

Anything else that should be part of the game world -- Player, NPC, whatever -- should also draw its images minus the Camera's x and y.

Anything that should be part of the HUD, rather than the game world, such as menus, should not draw minus the Camera's x and y. This way, even if the Camera moves, the menus and stuff will stay in the same spot on the screen.

The principle here is that when something moves (changes its x and y position), that means that it has moved around in the game world. The Player and the Tiles don't move when the Camera does. They stay in the same spot. But, when the Camera moves, while their x and y stay the same, they get drawn with an offset based on where the Camera is. This way, if you move your Camera, you don't have to move all your Players and Tiles, but it's like the person playing the game moves around instead.
14  Game Development / Newbie & Debugging Questions / Re: [Game] How do i make a camera.class? on: 2014-07-27 01:06:05
Looking at your source code, you would want to change this line in your Player.render(Graphics g):
g.drawImage(cheapAnimation(), x, y, width, height, null);

to something like this:
g.drawImage(cheapAnimation(), x - Camera.getX(), y - Camera.getY(), width, height, null);

This would mean that as you move the camera to the right, the player image moves to the left, and vice versa. You can do the same thing to your maps as well, so that as the camera moves, they move. If you want to keep a player or AI at the center of the screen, move the camera to their current position. Mine accomplishes this by Camera.centerOnCharacter(Person subject). If I want it to stay locked on to the player, I use that once each time I'm getting ready to draw everything. You could do the same (or modify my code if you like) by changing Person to Player and giving Player getCenterX() and getCenterY() methods so that the Camera knows where the middle of the player is, so that it can move to it.
15  Game Development / Newbie & Debugging Questions / Re: [Game] How do i make a camera.class? on: 2014-07-27 00:57:51
Ah, I've been typing up an answer for you! Here's how I do the making the screen move:

My game's camera works more or less like Pokémon's, with the player (or whoever we're looking at right now) staying at the center of the screen. The player and everybody else keep track of their own position relative to the level they're on. (My game calls these levels "Boards", but you could call them levels, maps, boards, areas, whatever you want.) If a Person (a character) is at x: 0, y: 0, that means they're at the very top left of the board.

When you update the screen, draw everything with an offset equal to the camera's x and y. Example:
drawThing(thing.getImage(), thing.x - Camera.getX(), thing.y - Camera.getY())
16  Game Development / Newbie & Debugging Questions / Re: [Game] How do i make a camera.class? on: 2014-07-27 00:49:00
For what it's worth, here's my Camera class. If any of it's of use to you (or anyone), feel free to use it for whatever.

It assumes certain things about what a Person is in your game (namely, that it's called Person, and it has getCenterX() and getCenterY() methods that tell you where the middle of the Person's graphic is relative to the game board/level). It also assumes that you have a thing called GameBase that has getCnvW() and getCnvH() to get the width and height of the drawable area of the game window, a variable brd to keep track of the current Board/Level, a variable to keep track of the main player character, and some numbers to symbolize directions (north, south, east, west) which can be sent in to the board/level's getBorder(directionNumber) method to find out where the edges of the level are.

package GameBase;

import Person.Person;

 * @author jemoore

public class Camera {
    private static double x = 0;
    private static double y = 0;
    public static int getX() {
        return (int) x;
    public static int getY() {
        return (int) y;
     * Move Camera's top-left corner a given number of pixels,
     * but only if this wouldn't move the camera past the board edges.

    public static void move(double x, double y) {
            //System.out.print("Camera moves from " + Camera.x + "," + Camera.y + " to ");
        set(Camera.x + x, Camera.y + y);
            //System.out.println(Camera.x + "," + Camera.y);
     * Set Camera to have its top-left corner be a given position,
     * but only if this wouldn't move the camera past the board edges.

    public static void set(double x, double y) {
        Board brd = GameBase.brd;
        int cnvW = GameBase.getCnvW();
        int cnvH = GameBase.getCnvH();
        double marginW = (cnvW - brd.getW())/2; //handle blank margins if canvas wider than board
        double marginH = (cnvH - brd.getH())/2;
            //System.out.print("Camera: cnvW,H="+cnvW+","+cnvH+" marginW,H="+marginW+","+marginH+" input x,y="+x+","+y);
        if(marginW < 0) { marginW = 0; }
        if(marginH < 0) { marginH = 0; }
        if(x + cnvW > brd.getBorder(GameBase.DIR_E) + marginW) { //can't move right
            x = brd.getBorder(GameBase.DIR_E) - cnvW + marginW;
        if(x < brd.getBorder(GameBase.DIR_W) - marginW) { //can't move left
            x = brd.getBorder(GameBase.DIR_W) - marginW;
        if(y < brd.getBorder(GameBase.DIR_N) - marginH) { //can't move up
            y = brd.getBorder(GameBase.DIR_N) - marginH;
        if(y > brd.getBorder(GameBase.DIR_S) - cnvH + marginH) { //can't move down
            y = brd.getBorder(GameBase.DIR_S) - cnvH + marginH;
        Camera.x = x;
        Camera.y = y;
            //System.out.println(" output x,y="+x+","+y);
     * Reset Camera to be centered on subject's position,
     * but only if this wouldn't move the camera past the board edges.

    public static void centerOnCharacter(Person subject) {
        centerOnCharacter(subject, 0, 0);
    public static void centerOnCharacter(Person subject, double offsetX, double offsetY) {
        int cnvW = GameBase.getCnvW();
        int cnvH = GameBase.getCnvH();
        double newX = subject.getCenterX() - cnvW/2 + offsetX;
        double newY = subject.getCenterY() - cnvH/2 + offsetY;
        Camera.set(newX, newY);
        //System.out.println("cam xy: " + Camera.getDrawX() + ", " + Camera.getDrawY());
    public static void centerOnMain() {
17  Java Game APIs & Engines / OpenGL Development / Re: LWJGL Controller Advice on: 2014-07-27 00:10:24
Having trouble getting it to recognize the binaries. It complained they weren't in java.library.path, so I set java.library.path to the same as org.lwjgl.librarypath , all before it ever tries to set up controllers, but it still complains. If I paste the same path into my NetBeans project properties -> run -> VM Options as -Djava.library.path="C:\Users\Joel\Documents\NetBeansProjects\hippo\native\windows" , it works. This, even though printing out java.library.path shows the same path whether I set it in the VM Options or in the program.

I'm trying this, but they call it a hack, which makes me raise an eyebrow about its reliability:

[EDIT: that hack appears to work, and my, it recognizes a lot of controllers. My Xbox 360 controller comes up first, then my keyboard (twice), my microphone (twice, but very interesting), then the driver for my wife's not-connected drawing tablet (also twice), though it claims it failed to initialize said tablet driver (did it fail on both versions that it saw? on one? on a third one that didn't end up in the controllers list?)]
18  Java Game APIs & Engines / OpenGL Development / Re: LWJGL Controller Advice on: 2014-07-26 23:22:35
Good idea. That's what I did for keyboard and mouse -- there are default bindings, but it's basically agnostic to the actual names of the keys or mice, so it should be easy to reconfigure for non-English keyboards and such. I'll be doing something similar for controllers.
19  Java Game APIs & Engines / OpenGL Development / LWJGL Controller Advice [Getting false axis events] on: 2014-07-26 20:49:19
So, I've got Keyboard and Mouse redone to use LWJGL instead of AWT or whatever built-in thing I'd been doing. Remapping works pretty well, and everything. And now, I'm going to try and take this 360 controller we bought and try to make that happen.

Any advice, as I dive in to controller support? Any major differences I should be aware of between how LWJGL treats controllers versus keyboards or mice?

I suppose if I run into any nasty, stumping problems, I'll edit or reply to this topic.
20  Java Game APIs & Engines / OpenGL Development / Re: AWT Frame and Canvas parented to LWJGL Display is resizing on creation on: 2014-05-26 19:30:21
Sorry for all the self-replies. I'm not sure whether to edit or add a new reply in cases like this, where it's new information being added.

As best I can tell, the window is being maximized behind my back somewhere. When the window ends up big instead of the size it's supposed to be, f.getExtendedState() is returning 6 of MAXIMIZED_BOTH instead of the 0 of NORMAL.
21  Java Game APIs & Engines / OpenGL Development / Re: AWT Frame and Canvas parented to LWJGL Display is resizing on creation on: 2014-05-26 18:52:56

Correction: It works sometimes. Other times, it still resizes the window to take up the whole screen.

EDIT: It also just used the right sized window, but the rendering was stretched, as if it was trying to stretch the correct size to fit a larger window than was there.

EDIT again: Looks like I'd also added an f.setMinimumSize() and f.setSize() after the second f.setVisible(). If I remove those, I get full screen sized window again.
22  Java Game APIs & Engines / OpenGL Development / Re: AWT Frame and Canvas parented to LWJGL Display is resizing on creation on: 2014-05-26 18:44:29
Thaaaaat was weird. If I add another f.setVisible(true) before the f.add(c), it works as it should. The window is the right size, the rendering is the right size and isn't squashed or stretched.

I guess Frames need to be set to validated or made displayable or something before a Canvas is added to them, or the Frame can get resized (and the canvas with it) somewhere behind the scenes later. This even works if I then remove the f.setVisible(true) that came after f.add(c), even though I thought that needed to be called to re-validate stuff after adding a component. Weird.
23  Game Development / Newbie & Debugging Questions / Re: Collision bug in a 2D platfrom game. on: 2014-05-26 18:26:31

Not sure if this will help with your specific problem, but it might be a better way to handle collisions during player movement.

You may find it useful to go ahead and move the character 1 pixel at a time until they've moved their whole speed -- but don't draw it yet! Every pixel the character moves, check to see if moving that pixel would make it collide with anything. Then, if it does, simply stop the movement before that pixel.

For simple collision, you can just see if a rectangle you make that surrounds it overlaps with the rectangles of other objects. Here is what you could do for each pixel of movement:
int moveX = 0;
int moveY = 0;
if(movingLeft) { moveX = -1; }
else if(movingRight) { moveX = 1; }
if(movingUp) { moveY = 1; } //assuming y goes up and not down
else if(movingDown) { moveY = -1; }

//box is the rectangle around your character used for checking collision
//obstacles is an ArrayList of every other rectangle on the level the character can collide with
Rectangle nextSpot = new Rectangle(box.x + moveX, box.y + moveY, box.width, box.height)
boolean collided = false;
for(Rectangle thing : obstacles) {
    if(nextSpot.intersects(thing)) {
        collided = true;
        break; //no need to continue checking obstacles -- we've hit one
if(collided == true) {
    //no more movement!
    //if we're inside another loop that goes until we've moved our whole speed,
    //we can get out of it with break.
} else {
    //move that little bit!
    playerX += moveX;
    playerY += moveY;

Then, once the character has moved as far as they can with that collision checking method, update the screen.
24  Java Game APIs & Engines / OpenGL Development / AWT Frame and Canvas parented to LWJGL Display is resizing on creation on: 2014-05-26 18:03:28
This is baffling me. For some reason, the AWT Frame and its child canvas that I'm using with LWJGL's Display.setParent() is resizing itself away from the dimensions I set it as. This used to work fine, and looking through my revision history, I can't figure out how I broke it.

Relevant parts of my code:
//Frame f is a static final that is initialized when it is declared.

setupFrame(Canvas c) {
        //determine the width and height to use for the game window, put them in resX, resY
        f.setSize(resX, resY);

setupLWJGL() {
        //locate natives, then...
        try {
            Display.setDisplayMode(new DisplayMode(resX, resY));
            Display.setParent(cnv); //cnv is the same as c from the setupFrame(Canvas c)
        } catch(LWJGLException ex) {
            Logger.getLogger(GameBase.class.getName()).log(Level.SEVERE, null, ex);
        cnvW = Display.getWidth();
        cnvH = Display.getHeight();
        //, blending, matrices, etc....

Currently, the size of the frame should be 1200x675, and the canvas and Display should be a little less than that (1194x647) because of window borders. However, at some point in the code, the frame and canvas (and thus Display) sizes change from about 1194x647 to 1280x1002.

I've been mucking around in NetBean's debug mode and also with a bunch of print statements to figure out where the canvas and frame end up changing their dimensions. This goes wrong in two different ways and seems to happen at two different spots:

1. Display.setDisplayMode(new DisplayMode(resX, resY)); Before that line, the canvas dimensions are 1194x647, afterward they are 1280x1002. The game renders correctly, but in a window that takes up the whole screen instead of 1200x675.

2. f.setVisible(true); The same dimension change occurs during that line. I tried to follow the source code, and it seems to happen when the Component calls peer.setVisible(true).

Sometimes, the window takes up the full screen (it is still a decorated window, it's not in full screen mode), but only draws on a section of it that looks like it's about the 1200x675 size the window is supposed to be. I can't reliably reproduce this, but it happens sometimes. Also, which spot the frame and canvas change dimensions at is unpredictable, but seems to happen more on f.setVisible() when I'm in debug mode.

I'm guessing this isn't actually due to something within the code I'm using so much as maybe a synchronization issue? Since it seems to change when it happens when I'm using debug mode, the timing seems important.

Any ideas?

EDIT: It looks like if I remove the Display.setDisplayMode(), which I think is supposed to be unnecessary anyway if I give the Display a parent, the resizing changes to during the Display.create() line, and I get the glitch where the window is still big, but the rendering is the right size and takes up only part of the window and is scaled oddly. No, wait... I just ran it again without setDisplayMode(), and it resized at Display.setParent(cnv) and rendered in the whole window. So, this is very inconsistent and seems to not be connected to any particular piece of code I'm writing.
25  Game Development / Newbie & Debugging Questions / Re: Hard to start a project. on: 2014-02-27 04:51:12
I'll pile on to what everyone else is saying.

Just start with what you can do, and do the best you can with that. If it turns out well, you can try to find someone to replace the art and music. Meanwhile, just hack together your own, even if it's bad, or find free stuff online. There is a significant amount of legitimately free resources, though if you use it in a game you release, you should double-check the licenses to make sure you don't have to pay or get permission or release the source code (unless of course you're ok with that!).
26  Game Development / Newbie & Debugging Questions / Re: Framerate cut in half when running by clicking jar vs command line or netbeans on: 2014-01-21 15:09:21

It feels inappropriate to reply just to say that. This forum feels too official. Maybe something's wrong with me.
27  Game Development / Newbie & Debugging Questions / Re: Framerate cut in half when running by clicking jar vs command line or netbeans on: 2014-01-21 14:34:46
Thanks, Cas!

I'll have to remember that about distributing the JRE with the game. I'm guessing a bit of searching will reveal some solutions or at least instructions for the best ways to do that.

Unfortunately, I'm pretty sure my netbook's video drivers are as up to date as I can get them. Intel 945GM does not appear to be the hottest thing around. Which brings up the related question of how to use OpenGL extensions with LWJGL, but I'll search around a bit more before starting a thread about that. (Unless you already have a link handy. Tongue )

Btw, I think it's cool that you frequent these forums. I loved Revenge of the Titans (despite not being able to tell what upgrades would do ahead of time), and I can't help but wonder how you find/steal time to answer newbie questions.
28  Game Development / Newbie & Debugging Questions / Re: Framerate cut in half when running by clicking jar vs command line or netbeans on: 2014-01-21 14:26:02
Haha, thanks for the advice.

Hm... well, I'm a little blurry on how forwards compatibility works in Java. If I wrote something in Java 7, and someone had Java 6, would it always work, sometimes work depending on the features I used, or never work? (Or maybe I could bypass the whole issue by distributing the right JRE with the game... I think I've heard you can do that.)

If there's no reason to use Java 6, then I might as well follow your advice.

As a side note, it's my personal irrational goal to make sure the game can run on my netbook, which, despite coming with Windows 7 Starter, for some reason only supports OpenGL 1.4. Even though it was made in 2009. So I guess I have a lot of sympathy for people on old machines that just want to play a game that doesn't really look like it should need a new machine.
29  Game Development / Newbie & Debugging Questions / Re: Framerate cut in half when running by clicking jar vs command line or netbeans on: 2014-01-20 06:14:05
Looks like you guys are probably right!

If I search "java" in the start menu, it quickly comes up with Configure Java, About Java, and java.exe. If I open Configure Java, I'm seeing that I have Java 1.7.0_45 listed first in the User tab, with 1.6.0_31 second, and both are enabled. The System tab just has 1.7. All are located in Program Files (x86). So it looks like Windows is set up to use 32bit JREs.

If I instead open About Java, it tells me 1.7.0_45-b18. Presumably the same JRE that is listed first in Configure Java.

However, in control panel (Win7) -> Java, it lists only 1.6.0_26 in both User and System tabs, located in Program Files. So, that would indicate Windows is set up to use a 64bit Java 1.6 JRE.

In Control Panel -> Programs and Features, it looks like I have the following installed:
Java 7 Update 45
Java 6 Update 26 (64bit)
Java 6 Update 31
Java SE Dev Kit 6 Update 26 (64-bit)
Java SE Dev Kit 7 (64bit)

The NetBeans project is set to use JDK 1.6 as the platform. Under Tools -> Java Platforms, I have JDK 1.6.0_26 as the default, followed by JDK 1.7.0. I did pick 1.6 intentionally, because I assumed developing for Java 6 would have a broader install base than Java 7, and it would let me get a better idea of how it would run on less up-to-date systems even if that wasn't true. I don't know if that's really the case.

If I check java -version in command prompt, I see:
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20,1-b02, mixed mode)

I guess what's going on is that command prompt and NetBeans are set to use 64bit Java 6, while double-clicking jars is set to use 32bit Java 7. Does that look like the case to you guys? do I straighten Windows out? It has two separate Java Control Panels, one accessible from Windows Control Panel (the 64bit Java 6), one accessible from the start menu (the 32bit Java 7 and Java 6).

And what should I expect users to have if it's this messy on mine?! Thanks for your help in at least steering me in the right direction so far.
30  Game Development / Newbie & Debugging Questions / Framerate cut in half when running by clicking jar vs command line or netbeans on: 2014-01-16 09:40:27
The framerate on my game drops from 16-19 to 10 when I run it from a jar by double-clicking. Running it from the same jar by command prompt or from the project itself in the IDE gives me the higher framerate.

I'm using LWJGL, but I've found posts about this problem both elsewhere and here by people not using OpenGL. No solutions that I noticed though.

Any ideas?
Pages: [1] 2
Ralphanese (16 views)
2015-05-29 13:07:55

Gibbo3771 (12 views)
2015-05-29 06:54:17

Ralphanese (23 views)
2015-05-28 16:52:52

theagentd (31 views)
2015-05-27 22:21:17

theagentd (35 views)
2015-05-27 22:21:08

CopyableCougar4 (25 views)
2015-05-27 19:24:50

MrMapcom (24 views)
2015-05-23 20:26:16

MrMapcom (32 views)
2015-05-23 20:23:34

Waterwolf (37 views)
2015-05-20 15:01:45

chrislo27 (44 views)
2015-05-20 03:42:21
Intersection Methods
by Roquen
2015-05-29 08:19:33

List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21

Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02 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‑
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!