Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (491)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (556)
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
1  Java Game APIs & Engines / OpenGL Development / Re: Libgdx question on: 2011-10-23 21:09:03
Interesting article. So Im guessing you all agree that Libgdx is the way to go for me to develop 2d and 3d for PC? I really dont wanna go the engine route, and this seems perfectly low level enough for me to learn a lot.
2  Java Game APIs & Engines / OpenGL Development / Re: Libgdx question on: 2011-10-21 20:43:27
Well thanks for all the advice. Honestly my focus is LARGELY on PC development. I didnt choose to learn Libgdx because of the Android functionality, it was more of a bonus for me. My dev choice was between C#/XNA and JAVA/some library. I really like Java, and I did some cool things with Slick, so I decided to keep going in Java. Libgdx seemed perfect because it seems progressive, has the LWJGL backend so I can mess with pure openGL if I want to, it has the option to easily convert to android given that I avoid pure LWJGL Smiley, plus the community seems strong.) I kind of dropped the idea of XNA just because I have heard mixed things about its future, but most importantly I have no interest in DirectX at all.

So does it seem like Libgdx is a solid library for a Java person who wants to focus on 2d PC games and eventually dabble in 3d games and 3d graphics in general?

I could go the C++/SFML route, but honestly I dont see the reason to program hobby games in C++. I have far more Java experience than any other language.
3  Java Game APIs & Engines / OpenGL Development / Re: Libgdx question on: 2011-10-21 03:12:52
Hi

Libgdx supports both OpenGL and OpenGL ES. Do you really need features introduced in OpenGL 4? OpenGL ES does not support immediate mode but even a newbie should not use it as it is really slow.

No I most definitely do not need the latest additions at this point. Its more about me wanting to learn pure opengl. I want some of what I do to transfer to PC openGL graphics programming. Honestly I dont know the details of OpenGL vs OpenGLES. My main target is PC, but I am using LIBGDX so that I have the option to do android if I feel like it. My alternative was to stick with slick, but it seems like Libgdx is moving ahead alot faster and Kev Glass even said himself that Slick is basically in a complete state. I figured I could move to LIBGDX and learn some opengl stuff along the way.
4  Java Game APIs & Engines / OpenGL Development / Re: Libgdx question on: 2011-10-20 16:39:45
So If my app was only intedned for PC I could just call pure LWJGL? Thats good to know. Is there any particular reason that I would want to do that? Does OpenGL ES lack anything that the pc version offers? Im hoping to learn a bunch about plain old opengl while using Libgdx as well, thats why this was a concern. I didnt want to be forced to use ES.
5  Java Game APIs & Engines / OpenGL Development / Libgdx question on: 2011-10-20 14:59:07
Hey guys,

      So I have decided to invest time into learning Libgdx. I have successfully used Slick2d for a while, but I think that Libgdx is the direction I want to move in. My question is, in the docs I noticed that GL10 and the other GL classes are using OpenGL ES. Is that the only opengl available through Libgdx? I was hoping that I could access standard desktop Opengl with it, and not just the embedded systems version. Since Libgdx uses a LWJGL backend, I assumed I could access raw OpenGL calls, even up to version 4. Is this possible?
6  Discussions / General Discussions / Best general game programing books on: 2011-04-09 02:26:05
Hey guys,

      So in general it seems like the java game books arent so great, the ones Ive read anyway. Ive been thinking, couldnt I just read a more general beginner game programming book? Arent there books that discuss various game coding topics, such as making scrolling backgrounds, tilemaps, collision, etc, etc?? Even if a book used another language, Im sure I would be able to translate it to Java code. So are there any really good, clear books like this. My current goal is 2d games but I want to learn 3d in the future. I would just love a book that explains how to create the most important parts of games. For instance I want to make a 2d top down zelda type game, but Im lost as to how to implement a level system that scrolls with tiles and all that. So any recommendations? Or is it a bad idea to use a non java book for this?
7  Game Development / Newbie & Debugging Questions / Re: Making a map editor on: 2011-04-07 02:55:48
thanks ra4king, Im gonna need to look over this a bit more. It wasnt showing my desktop before, must be something I messed with. I even commented out the canvases to try to get it to work the way it used to, just with the jpanels, but no luck. If you have any ideas let me know. If not, Ill be picking at this for a while until I get it. Thanks again!

I think I might take as much swing out of this project as possible, and do what you said. I guess I can just size the canvases appropriately and just put them in the JFrame, avoiding the panels completely.
8  Game Development / Newbie & Debugging Questions / Re: Making a map editor on: 2011-04-07 01:54:49
You were getting that IllegalStateException because you need to call mainFrame.setVisible(true) before creating the BufferStrategy.

EDIT: Putting "createBufferStrategy(2)" in addNotify() works too Cheesy

Also, you can completely avoid using JPanel here at all. I don't understand why you need to add each Canvas to a JPanel when adding them directly to the JFrame works too. Also, you don't need to call "getContentPane()" because that is done automatically for you for the "add()" and "setLayout()" methods.

1  
2  
3  
4  
...
mainFrame.add(mapCanvas, BorderLayout.CENTER);
mainFrame.add(tileLibraryCanvas, BorderLayout.WEST);
...


Thanks! Well I was using JPanels as a way to separate the frame into 2 sections, one for the map and one for the tile selection. If I just added the canvases directly to the JFrame, how would I go about keeping them on their own side of the frame? The idea was to have about 1/3 of the frame be the tiles library and the rest to be the actual area to drop the tiles.

Also, even when I got rid of the error and stopped getting the contentpane, its still broken. Before I did anything with the canvases I could at least see my panels and borders, now my frame is basically just blank entirely, its actually glitched and showing a view of whats on my  desktop.
9  Game Development / Newbie & Debugging Questions / Re: Making a map editor on: 2011-04-07 01:29:11
Ok so I found out that I was trying to get the buffer before the canvas was added to the JPanel. I read that If I add this to addNotify(), it will only happen when its added to the panel. The error is gone but now I cant even see my panels at all. Whats going on? Building the Frame and Panel and Canvas layer is confusing me and I think I must be missing something.

Heres the new code:

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  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
package userInterface;

import java.awt.BorderLayout;
import java.awt.Canvas;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.MenuBar;

import javax.swing.BorderFactory;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JPanel;
import javax.swing.JScrollBar;
import javax.swing.border.Border;

public class Window {

   //window areas
  private JFrame mainFrame;

   private JPanel canvasPanel;
   private JPanel tileLibraryPanel;

   //drawing canvases
  private TileLibraryCanvas tileLibraryCanvas;
   private MapCanvas mapCanvas;

   //menubar
  private JMenuBar menuBar;
   private JMenu fileButton;

   //borders
  Border tileLibraryBorder;
   Border canvasAreaBorder;



   public Window() {

      //initializng the frame and inner panels
     mainFrame = new JFrame("Map Editor");
      canvasPanel = new JPanel();
      tileLibraryPanel = new JPanel();

      //initializing the canvases
     tileLibraryCanvas = new TileLibraryCanvas();
      mapCanvas = new MapCanvas();

      //initializing menu bar and items
     menuBar = new JMenuBar();
      fileButton = new JMenu("File");

      //adding the menubar to the frame
     mainFrame.setJMenuBar(menuBar);

      //adding the filebutton to the menu bar
     menuBar.add(fileButton);

      //creating borders
     Border tileLibraryBorder = BorderFactory.createTitledBorder("Tile Library");
      Border canvasAreaBorder = BorderFactory.createTitledBorder("Map");

      //setting panel sizes
     canvasPanel.setPreferredSize(new Dimension(600, 600));
      tileLibraryPanel.setPreferredSize(new Dimension(200, 600));

      //adding things to panels
     canvasPanel.setBorder(canvasAreaBorder);
      tileLibraryPanel.setBorder(tileLibraryBorder);

      canvasPanel.add(mapCanvas);
      tileLibraryPanel.add(tileLibraryCanvas);

      //setting layout and adding panels to frame
     mainFrame.getContentPane().setLayout(new BorderLayout());
      mainFrame.getContentPane().add(canvasPanel, BorderLayout.CENTER);
      mainFrame.getContentPane().add(tileLibraryPanel, BorderLayout.WEST);


      //setting various attributes
     mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      mainFrame.setPreferredSize(new Dimension(800, 600));
      mainFrame.setResizable(false);
      mainFrame.setIgnoreRepaint(true);
      mainFrame.pack();
      mainFrame.setVisible(true);

   }

}


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  
package userInterface;

import java.awt.Canvas;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.image.BufferStrategy;

public class TileLibraryCanvas extends Canvas {


   BufferStrategy bufferStrategy;

   public TileLibraryCanvas() {

      setVisible(true);
      setIgnoreRepaint(true);


   }

   public void render() {

      Graphics2D g = (Graphics2D) bufferStrategy.getDrawGraphics();

      g.setColor(Color.GREEN);
      g.fillRect(0, 0, 90, 50);

      g.dispose();
      bufferStrategy.show();
   }

   public void addNotify() {

      super.addNotify();

      createBufferStrategy(2);
      bufferStrategy = getBufferStrategy();
   }
}


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  
package userInterface;

import java.awt.Canvas;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.image.BufferStrategy;

public class MapCanvas extends Canvas {

   private static final long serialVersionUID = 5075462132756421808L;

   BufferStrategy bufferStrategy;

   public MapCanvas() {

      setVisible(true);
      setIgnoreRepaint(true);


   }


   public void render() {

      Graphics2D g = (Graphics2D) bufferStrategy.getDrawGraphics();

      g.setColor(Color.GREEN);
      g.fillRect(0, 0, 90, 50);  
     
      g.dispose();
      bufferStrategy.show();
   }
   
   public void addNotify() {

      super.addNotify();

      createBufferStrategy(2);
      bufferStrategy = getBufferStrategy();
   }
}
10  Game Development / Newbie & Debugging Questions / Re: Making a map editor on: 2011-04-06 20:41:24
Ok maybe you guys can help, heres my code. Apparently something is wrong with my buffer strategys when I create the buffer. Any ideas?? This code has worked fine in my games...!

Heres the main Window class

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  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
package userInterface;

import java.awt.BorderLayout;
import java.awt.Canvas;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.MenuBar;

import javax.swing.BorderFactory;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JPanel;
import javax.swing.JScrollBar;
import javax.swing.border.Border;

public class Window {

   //window areas
  private JFrame mainFrame;

   private JPanel canvasPanel;
   private JPanel tileLibraryPanel;

   //drawing canvases
  private TileLibraryCanvas tileLibraryCanvas;
   private MapCanvas mapCanvas;

   //menubar
  private JMenuBar menuBar;
   private JMenu fileButton;

   //borders
  Border tileLibraryBorder;
   Border canvasAreaBorder;



   public Window() {

      //initializng the frame and inner panels
     mainFrame = new JFrame("Map Editor");
      canvasPanel = new JPanel();
      tileLibraryPanel = new JPanel();

      //initializing the canvases
     tileLibraryCanvas = new TileLibraryCanvas();
      mapCanvas = new MapCanvas();

      //initializing menu bar and items
     menuBar = new JMenuBar();
      fileButton = new JMenu("File");

      //adding the menubar to the frame
     mainFrame.setJMenuBar(menuBar);

      //adding the filebutton to the menu bar
     menuBar.add(fileButton);

      //creating borders
     Border tileLibraryBorder = BorderFactory.createTitledBorder("Tile Library");
      Border canvasAreaBorder = BorderFactory.createTitledBorder("Map");

      //setting panel sizes
     canvasPanel.setPreferredSize(new Dimension(600, 600));
      tileLibraryPanel.setPreferredSize(new Dimension(200, 600));

      //adding things to panels
     canvasPanel.setBorder(canvasAreaBorder);
      tileLibraryPanel.setBorder(tileLibraryBorder);

      canvasPanel.add(mapCanvas);
      tileLibraryPanel.add(tileLibraryCanvas);

      //setting layout and adding panels to frame
     mainFrame.getContentPane().setLayout(new BorderLayout());
      mainFrame.getContentPane().add(canvasPanel, BorderLayout.CENTER);
      mainFrame.getContentPane().add(tileLibraryPanel, BorderLayout.WEST);


      //setting various attributes
     mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      mainFrame.setPreferredSize(new Dimension(800, 600));
      mainFrame.setResizable(false);
      mainFrame.pack();
      mainFrame.setVisible(true);

   }

}



And here are the two canvases, they are identical basically
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  
package userInterface;

import java.awt.Canvas;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.image.BufferStrategy;

public class MapCanvas extends Canvas {

   private static final long serialVersionUID = 5075462132756421808L;

   BufferStrategy bufferStrategy;

   public MapCanvas() {

      setVisible(true);
      setIgnoreRepaint(true);

      createBufferStrategy(2);
      bufferStrategy = getBufferStrategy();

   }


   public void render() {

      Graphics2D g = (Graphics2D) bufferStrategy.getDrawGraphics();

      g.setColor(Color.GREEN);
      g.fillRect(0, 0, 90, 50);  
   }
}


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  
package userInterface;

import java.awt.Canvas;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.image.BufferStrategy;

public class TileLibraryCanvas extends Canvas {


   BufferStrategy bufferStrategy;
   
   public TileLibraryCanvas() {

      setVisible(true);
      setIgnoreRepaint(true);
     
      createBufferStrategy(2);
      bufferStrategy = getBufferStrategy();

   }

   public void render() {

      Graphics2D g = (Graphics2D) bufferStrategy.getDrawGraphics();
     
      g.setColor(Color.GREEN);
      g.fillRect(0, 0, 90, 50);  
   }
}


Heres the error:

Exception in thread "main" java.lang.IllegalStateException: Component must have a valid peer
   at java.awt.Component$FlipBufferStrategy.createBuffers(Unknown Source)
   at java.awt.Component$FlipBufferStrategy.<init>(Unknown Source)
   at java.awt.Component$FlipSubRegionBufferStrategy.<init>(Unknown Source)
   at java.awt.Component.createBufferStrategy(Unknown Source)
   at java.awt.Canvas.createBufferStrategy(Unknown Source)
   at java.awt.Component.createBufferStrategy(Unknown Source)
   at java.awt.Canvas.createBufferStrategy(Unknown Source)
   at userInterface.TileLibraryCanvas.<init>(TileLibraryCanvas.java:19)
   at userInterface.Window.<init>(Window.java:48)
   at userInterface.Driver.main(Driver.java:7)


I want to note that if I pass 1 to createBufferStrategy() it compiles and runs, but the canvases are not painted so Im not even sure if theyre there.
11  Game Development / Newbie & Debugging Questions / Re: Making a map editor on: 2011-04-06 16:39:21
Ok see what you mean now :-) Swing issues huh.. Can't really help you with this (hate Swing).  In the past I created a couple of Map Editors using plain Java2D, and using the techniques I described earlier to place the tiles/save the array.  It worked very well and was very easy to code, however not really suitable if you want other users to use your tool, in which case better stick with your approach... Good luck!

Yes I hate swing dearly. My plan was to mainly use Java2d. The only place I am touching swing is my main Frame and Panels. Once I added my 2 canvases to their respective panels I was planning on doing all of the scrollbars, buttons, graphics, etc with custom JAva2d shapes and images. The only reason I was using Jpanels is because I really dont know any other way of supporting a canvas. The only way Ive ever known to do this (I use this in games as well) Is to make a JFrame, pack a Jpanel in it, then add a canvas to that Jpanel. Then I create a buffer strategy on the canvas and get the graphics context from that buffer strategy and use that to draw. IS there a way to avoid Jpanels and all that?

Also, I like to write my own render methods so I dont use paint() and repaint() at all. Thats why I use the buffer strategy to get the Graphics object.
12  Game Development / Newbie & Debugging Questions / Re: Making a map editor on: 2011-04-06 15:10:26
Well yes those example programs are pretty much what I want to make. I do want to make my own though, I think it will be a good learning experience. I think getting the mouse coordinates should work. What I have set up now is one main JFrame, and 2 JPanels (one for the actual map and one for the library of tiles). My plan was to put a separate canvas on each of the panels so that I can draw on each section separately. Ive been having some problems getting both canvases working. I never experience an issue in my games drawing on one canvas, but adding two different canvases to two different panels is creating an issue. I think I might just be messing up the packing with swing. Ill post code later to show you guys.
13  Game Development / Newbie & Debugging Questions / Making a map editor on: 2011-04-06 13:51:23
Hey Guys,

     So I thought It would be useful to make myself a simple tile map editor. My plan is to have a window with 2 sections, a tile library and a grid canvas. The user can select a tile type from the library and use it to paint onto the grid. The plan is to store this as a simple 2d array, then when saved, write it to a file using numbers (1 is grass, 2 is water, 3 is dirt, etc) The problem is I am having trouble getting the design down. I cant figure out how to translate what they place in the grid into an array, and then translate that to a file. I guess Im having a disconnection between the GUI and the back end and I cant figure out how to have them communicate
14  Game Development / Newbie & Debugging Questions / Re: Sprite Sheet Splitting on: 2011-04-04 13:46:41
No, if you have a background that is not translucent, you have to have a method in your code that will check each pixel for that color and change it to 0-alpha.

Ok, so if I make my own sheet, is there some way to make it translucent in photoshop? Im guessing by just erasing the background that will make it translucent? Checking each pixel seems like unnecessary work, Id rather just make the background translucent to begin with.
15  Game Development / Newbie & Debugging Questions / Re: Sprite Sheet Splitting on: 2011-04-03 15:21:01
So having a translucent background doesnt necessarily mean that when I look at the sprite sheet I cant see the background right? For instance I have a sheet with a kind of blueish background, is it possible that it is translucent when actually rendered into a program?
16  Game Development / Newbie & Debugging Questions / Re: Sprite Sheet Splitting on: 2011-04-03 04:03:22
Well I have photoshop CS3, would that work?
17  Game Development / Newbie & Debugging Questions / Re: Sprite Sheet Splitting on: 2011-04-03 02:54:45
So If I get a sprite sheet off the web, I'm guessing that the backgrounds aren't transparent right? Is there a way to make it transparent? If not, how do I even go about making my own sheet with a transparent background?
18  Game Development / Newbie & Debugging Questions / Sprite Sheet Splitting on: 2011-04-03 02:28:40
Hey Guys,

     So Ive been reading about having your game split up a sprite sheet automatically and use frames for animations. It makes sense and all, but what I dont get is how to get the images to appear correctly. What I mean is, normally without a sprite sheet, Ive been taking a single image into photoshop and using the lasso tool to cut out the background. With a sprite sheet, if the program is just creating an image from a certain piece of the big sprite sheet image, it is going to be cutting out a rectangle shaped image. How am I going to get rid of the background so that the image actually looks correct and not an image drawn on some rectangle? Get what I mean? The background, whatever color it may be, will still be visible where ever there is no image within the rectangle.
19  Game Development / Newbie & Debugging Questions / Re: Moving Images on: 2011-03-23 04:06:31
Gotcha, Ok Im going to mess with this a bit. Any other advice on the subject is always welcome.
20  Game Development / Newbie & Debugging Questions / Re: Moving Images on: 2011-03-23 03:44:08
Ok so my current method of image loading is the use of ImageIcons and Images. Typical image code for me is this :

ImageIcon icon = new ImageIcon(this.getClass().getResource("filename.png"));
Image image = icon.getImage();

then I have the full image stored in image. Is this considered a good way to do it? So if I continue to use this method, I would just have multiple images in different actions and paint the appropriate one for each frame?

I kind of always thought that a sprite was always animated, but the term sprite just refers to a static image as well. So basically I am creating a sort of stop motion animation by changing poses of the character quickly?
21  Game Development / Newbie & Debugging Questions / Moving Images on: 2011-03-22 23:11:56
Hey Guys,

      So far all Ive made is games where I use static images for characters and enemies, and it looks really cheesy. How can I create a real looking animation, nothing fancy, like original zelda for instance? Im guessing I need to use sprites? I want the character to actually move its legs or swing a sword, and not just look like an image sliding around the screen. Any help?
22  Game Development / Newbie & Debugging Questions / Re: LWJGL Beginning on: 2011-03-18 20:10:30
Ok, so if I were to get the SuperBible, should I get the 4th edition from 2007 or the 5th from 2010?
23  Game Development / Newbie & Debugging Questions / Re: LWJGL Beginning on: 2011-03-18 18:23:39
Ok so the latest edition of the RedBook got awful reviews saying that 90% of the code is deprecated.. any truth to this? I was thinking of getting the superbible. Some people said to get the older edition, something about OpenGl switching something with functions and pipelining in the newer releases?? Honestly I have no idea what theyre talking about, I just want to get the best book lol.
24  Game Development / Newbie & Debugging Questions / Re: LWJGL Beginning on: 2011-03-17 15:32:00
Ah ok, a game engine is NOT what I wanted so this is good. Im going to pick up a good OpenGL book then or read some docs online. Thanks for the help guys. What Im curious about is, does LWJGL support image loading and all of that stuff or am I going to need to use SLICK2d or some other libraries. My goal is to learn as much of the lower level stuff as possible, without the unnecessarily low level stuff of course. So would I not be able to use the old java classes such as Image and ImageIcon while using LWJGL? Or can I combine them? This is actually pretty confusing
25  Game Development / Newbie & Debugging Questions / Re: LWJGL Beginning on: 2011-03-17 04:37:00
Wait, so the LWJGL syntax is the same as plain OPENGL? So does LWJGL just add some methods specific to game creation?? Confused now!
26  Game Development / Newbie & Debugging Questions / LWJGL Beginning on: 2011-03-17 03:31:25
hey guys,
     
          Even though Im still learning to get better at using just core Java for games, I want to begin messing with LWJGL drawing. I started with the tutorials at NinjaCave, and they were helpful. I really like to learn from the API documentation, but the javadocs for the LWJGL are basically non existant. I looked in the documentation for the GL11 class, and there are no descriptions at all for the fields or methods. The only things I found actual write ups for are the Mouse, Keyboard, Display, etc classes. So Is there somewhere that I can learn what all these methods and fields are?? Some examples:

GL11.glMatrixMode(GL11.GL_PROJECTION);
      GL11.glLoadIdentity();
      GL11.glOrtho(0, 800, 600, 0, 1, -1);
      GL11.glMatrixMode(GL11.GL_MODELVIEW);

This stuff works... but I have NO IDEA what is what
27  Game Development / Newbie & Debugging Questions / Re: Movement Speed on: 2011-03-15 16:48:28
Hey, Heres the screenshot of the game. See the unpainted bottom and right? The character kind of leaves a trail on it when walking...

crap, how do I post an image thats local on my pc?
28  Game Development / Newbie & Debugging Questions / Re: Movement Speed on: 2011-03-15 02:30:36
So can I just import applet and use the method?? Or does my actual game need to be an applet?

Also, I will post a screenshot of the painting problem once I get on another computer. Thanks again for all of this help. I am learning SO MUCH
29  Game Development / Newbie & Debugging Questions / Re: Movement Speed on: 2011-03-14 14:23:58
Thanks guys. Its working pretty well now. I just seem to be having an issue where when I run it from eclipse it looks ok. But I exported it as a Runnable jar to put on my website and opened it on another computer, the painting was off by about 10 pixels. Basically the right and bottom of the screen wasnt getting painted, it seemed like the rectangle that I was blanking the screen out with every loop was offset by a bit. Im guessing this is because Im using hard coded coordinates 800X400, and instead I should be using some sort of method that gets the size directly from the component? Im thinking this has to do with differences in the Frames on different operating systems.

Other than that, I just need to figure out how to get a sound clip to play when I press a button, and Im good to go
30  Game Development / Newbie & Debugging Questions / Re: Movement Speed on: 2011-03-13 21:45:00
AHHH Gothca.. Ok so should it be

xPosition = (xPosition + ((xSpeed * (double)timeDiff) / 1000 ));

or 


xPosition = (xPosition + (xSpeed * ((double)timeDiff) / 1000));


basically, should I multiply xSpeed and timediff then divide that result by 1000, or should I divide timediff by 1000, then multiply that result by xSpeed?
Pages: [1] 2 3
 

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

The first screenshot will be displayed as a thumbnail.

Nickropheliac (15 views)
2014-08-31 22:59:12

TehJavaDev (23 views)
2014-08-28 18:26:30

CopyableCougar4 (32 views)
2014-08-22 19:31:30

atombrot (41 views)
2014-08-19 09:29:53

Tekkerue (40 views)
2014-08-16 06:45:27

Tekkerue (35 views)
2014-08-16 06:22:17

Tekkerue (25 views)
2014-08-16 06:20:21

Tekkerue (37 views)
2014-08-16 06:12:11

Rayexar (72 views)
2014-08-11 02:49:23

BurntPizza (49 views)
2014-08-09 21:09:32
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

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

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

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!