Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (577)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  [Solved] Calling a class  (Read 3047 times)
0 Members and 1 Guest are viewing this topic.
Offline deadteck

Senior Newbie





« Posted 2012-04-22 13:51:00 »

I Solved it no need to worry about this. But if you want to know what I did, I just made a nooby mistake and forgot to set it as public static void  Cranky

The best ideas will come from the weirdest and sometimes most f***'d up places, you just have to realize them.
Offline ReBirth
« Reply #1 - Posted 2012-04-23 00:16:53 »

If it is then maybe you had problem in calling the method.

Offline deadteck

Senior Newbie





« Reply #2 - Posted 2012-04-23 03:21:46 »

If it is then maybe you had problem in calling the method.
I dont think it was that, I think its that I just needed to set both of my methods (the caller and the called) to static because after I did that it was fixed Smiley

The best ideas will come from the weirdest and sometimes most f***'d up places, you just have to realize them.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline ReBirth
« Reply #3 - Posted 2012-04-23 04:04:43 »

I undertstand if you need the called method to be static
1  
 MyClass.staticMethod() 
but static caller method?

Offline jonjava
« Reply #4 - Posted 2012-04-23 10:02:16 »

On the off-chance you might be using the static keyword unnecessarily (which might quickly snowball into making everything static - a big no no), since mostly only the 'public static void main()" method is static. Here's a quick rundown on how you use a class and its methods typically.

To use a class and its methods, you first need to create a new instance of the class with the new keyword. This is usually done in the 'public static void main' method - the method that starts off the application. Ie, create a new instance of the class and save it inside a variable for later use.

For example:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
public class Dog {
 // public method
 public void bark() {
  System.out.println("Woof!");
 }

 // Start the application
 public static void main(String[] argv) {
  Dog dog;
  dog = new Dog();
 
  // Use dog's public method
  dog.bark();
 }
}

Offline deadteck

Senior Newbie





« Reply #5 - Posted 2012-04-24 03:01:18 »

On the off-chance you might be using the static keyword unnecessarily (which might quickly snowball into making everything static - a big no no), since mostly only the 'public static void main()" method is static. Here's a quick rundown on how you use a class and its methods typically.

To use a class and its methods, you first need to create a new instance of the class with the new keyword. This is usually done in the 'public static void main' method - the method that starts off the application. Ie, create a new instance of the class and save it inside a variable for later use.
thanks, but what if I want to call an external class. And when do u use static Huh

The best ideas will come from the weirdest and sometimes most f***'d up places, you just have to realize them.
Offline jonjava
« Reply #6 - Posted 2012-04-24 03:31:03 »

What do you mean by an external class?

To use external classes/libraries in your program you usually have to actually include these files in your program. Ie, copy pasting them into your project folder.

Classes in the same package can see and talk to each other by default. If you declare the class "public" it can be used by anyone.

You can sort classes into different packages ( basically just regular folders ) and in order to use classes inside these packages/folders you need to specify the package name before the class.

Consider we have two packages, one called "main" and the other "somepackage". Both packages have a class named "Dog".

To specify wich Dog class you're using you need to write either "main.Dog dog = new main.Dog()" or "somepackage.Dog dog = new somepackage.Dog()";

Or you can use the import java keyword to tell the compiler to include the public classes from a specific package. Ex:
1  
2  
3  
import somepackage.*; // import all public classes from package
...
Dog dog = new Dog(); // compiler now knows to look for the Dog class in somepackage package.


Specifying the classpaths also lets you use "external classes".

I really recommend for you to read the java oracle beginners tutorials. They explain very well the gist of what java is about.

Offline ReBirth
« Reply #7 - Posted 2012-04-24 10:37:51 »

Static method is usually used on singleton class. You don't want to instance it because it is used by other so many classes. For example a class that holds boring functions but stateless such as lang.Math.

Offline princec

JGO Kernel


Medals: 404
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #8 - Posted 2012-04-24 10:41:46 »

Argh, did you edit the original post? Now we've got an "orphaned" thread where nobody knows what was originally being talked about, left over in the archives for all time.

Cas Smiley

Offline cylab

JGO Ninja


Medals: 52



« Reply #9 - Posted 2012-04-24 11:57:30 »

@princec
nevermind, they all started responding _after_ he removed his original post  Roll Eyes

@deadteck
you are on the wrong track (on the wood way, haha) - read up on the difference between Classes and Instances...

(hint: a Class is more of a concept or blueprint, while an instance is an Object made with the help of a Class - you usually won't interact with Classes other than using them in conjunction with new - public static void main() being a historic and imho confusing exception...)

Mathias - I Know What [you] Did Last Summer!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline ReBirth
« Reply #10 - Posted 2012-04-24 12:11:08 »

Argh, did you edit the original post? Now we've got an "orphaned" thread where nobody knows what was originally being talked about, left over in the archives for all time.

Cas Smiley
I'm the devil who caused all of this  Stare

Offline deadteck

Senior Newbie





« Reply #11 - Posted 2012-04-25 00:12:16 »

Ok, i think I understand what you are all getting to but im still getting an error about different statics and stuff

Render 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  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
107  
108  
109  
110  
111  
112  
113  
114  
115  
116  
117  
118  
119  
120  
121  
122  
123  
124  
125  
126  
127  
128  
129  
130  
131  
132  
133  
134  
135  
136  
137  
138  
139  
140  
141  
142  
143  
144  
145  
146  
147  
148  
149  
150  
151  
152  
153  
154  
155  
156  
157  
158  
159  
160  
161  
162  
163  
164  
165  
166  
167  
168  
169  
170  
171  
172  
173  
174  
175  
176  
177  
178  
179  
180  
181  
182  
183  
184  
185  
186  
187  
188  
189  
190  
191  
192  
193  
194  
195  
196  
197  
198  
199  
200  
201  
202  
203  
204  
205  
206  
207  
208  
209  
210  
211  
212  
213  
214  
215  
216  
217  
218  
219  
220  
221  
222  
223  
224  
225  
226  
227  
228  
229  
230  
231  
232  
233  
234  
235  
236  
237  
238  
239  
240  
241  
242  
243  
244  
245  
246  
247  
248  
249  
250  
251  
252  
253  
254  
255  
256  
257  
258  
259  
260  
261  
262  
263  
264  
265  
266  
267  
268  
269  
270  
271  
272  
273  
274  
275  
276  
277  
278  
279  
280  
package com.game.Fearless;

import static org.lwjgl.opengl.GL11.GL_ALPHA_TEST;
import static org.lwjgl.opengl.GL11.GL_BACK;
import static org.lwjgl.opengl.GL11.GL_BLEND;
import static org.lwjgl.opengl.GL11.GL_COLOR_BUFFER_BIT;
import static org.lwjgl.opengl.GL11.GL_COMPILE;
import static org.lwjgl.opengl.GL11.GL_CULL_FACE;
import static org.lwjgl.opengl.GL11.GL_DEPTH_BUFFER_BIT;
import static org.lwjgl.opengl.GL11.GL_DEPTH_TEST;
import static org.lwjgl.opengl.GL11.GL_FOG;
import static org.lwjgl.opengl.GL11.GL_FOG_COLOR;
import static org.lwjgl.opengl.GL11.GL_FOG_DENSITY;
import static org.lwjgl.opengl.GL11.GL_FOG_END;
import static org.lwjgl.opengl.GL11.GL_FOG_HINT;
import static org.lwjgl.opengl.GL11.GL_FOG_MODE;
import static org.lwjgl.opengl.GL11.GL_FOG_START;
import static org.lwjgl.opengl.GL11.GL_LINEAR;
import static org.lwjgl.opengl.GL11.GL_MODELVIEW;
import static org.lwjgl.opengl.GL11.GL_NEAREST;
import static org.lwjgl.opengl.GL11.GL_NICEST;
import static org.lwjgl.opengl.GL11.GL_ONE_MINUS_SRC_ALPHA;
import static org.lwjgl.opengl.GL11.GL_PERSPECTIVE_CORRECTION_HINT;
import static org.lwjgl.opengl.GL11.GL_PROJECTION;
import static org.lwjgl.opengl.GL11.GL_QUADS;
import static org.lwjgl.opengl.GL11.GL_RGBA;
import static org.lwjgl.opengl.GL11.GL_SRC_ALPHA;
import static org.lwjgl.opengl.GL11.GL_TEXTURE_2D;
import static org.lwjgl.opengl.GL11.GL_TEXTURE_MAG_FILTER;
import static org.lwjgl.opengl.GL11.GL_TEXTURE_MIN_FILTER;
import static org.lwjgl.opengl.GL11.GL_TRIANGLES;
import static org.lwjgl.opengl.GL11.GL_UNSIGNED_BYTE;
import static org.lwjgl.opengl.GL11.glBegin;
import static org.lwjgl.opengl.GL11.glBindTexture;
import static org.lwjgl.opengl.GL11.glBlendFunc;
import static org.lwjgl.opengl.GL11.glCallList;
import static org.lwjgl.opengl.GL11.glClear;
import static org.lwjgl.opengl.GL11.glClearColor;
import static org.lwjgl.opengl.GL11.glColor4f;
import static org.lwjgl.opengl.GL11.glCullFace;
import static org.lwjgl.opengl.GL11.glDeleteTextures;
import static org.lwjgl.opengl.GL11.glDisable;
import static org.lwjgl.opengl.GL11.glEnable;
import static org.lwjgl.opengl.GL11.glEnd;
import static org.lwjgl.opengl.GL11.glEndList;
import static org.lwjgl.opengl.GL11.glFog;
import static org.lwjgl.opengl.GL11.glFogf;
import static org.lwjgl.opengl.GL11.glFogi;
import static org.lwjgl.opengl.GL11.glGenLists;
import static org.lwjgl.opengl.GL11.glGenTextures;
import static org.lwjgl.opengl.GL11.glHint;
import static org.lwjgl.opengl.GL11.glLoadIdentity;
import static org.lwjgl.opengl.GL11.glMatrixMode;
import static org.lwjgl.opengl.GL11.glNewList;
import static org.lwjgl.opengl.GL11.glRotatef;
import static org.lwjgl.opengl.GL11.glTexCoord2f;
import static org.lwjgl.opengl.GL11.glTexImage2D;
import static org.lwjgl.opengl.GL11.glTexParameteri;
import static org.lwjgl.opengl.GL11.glTranslatef;
import static org.lwjgl.opengl.GL11.glVertex3d;
import static org.lwjgl.opengl.GL11.glVertex3f;
import static org.lwjgl.opengl.GL11.glViewport;
import static org.lwjgl.util.glu.GLU.gluPerspective;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
import java.nio.FloatBuffer;

import org.lwjgl.BufferUtils;
import org.lwjgl.opengl.Display;

import de.matthiasmann.twl.utils.PNGDecoder;
import de.matthiasmann.twl.utils.PNGDecoder.Format;

public class Render extends Fearless {

   static float rotationx = Input.rotation.x;
   static float rotationy = Input.rotation.y;
   static float rotationz = Input.rotation.z;
   static float positionx = Input.position.x;
   static float positiony = Input.position.y;
   static float positionz = Input.position.z;
   
   public void render() {
      int endTexture = glGenTextures();
      {
         InputStream in = null;
         try {
            in = new FileInputStream("bin/images/floor.png");
            PNGDecoder decoder = new PNGDecoder(in);
            ByteBuffer buffer = BufferUtils.createByteBuffer(4
                  * decoder.getWidth() * decoder.getHeight());
            decoder.decode(buffer, decoder.getWidth() * 4, Format.RGBA);
            buffer.flip();
            in.close();
            glBindTexture(GL_TEXTURE_2D, endTexture);
            glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,
                  GL_NEAREST);
            glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
                  GL_NEAREST);
            glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, decoder.getWidth(),
                  decoder.getHeight(), 0, GL_RGBA, GL_UNSIGNED_BYTE,
                  buffer);
            glBindTexture(GL_TEXTURE_2D, 0);
         } catch (FileNotFoundException ex) {
            System.err.println("Failed to find the texture files.");
         } catch (IOException ex) {
            System.err.println("Failed to load the texture files.");
         }
      }

      glMatrixMode(GL_PROJECTION);
      glLoadIdentity();
      gluPerspective(fov,
            (float) Display.getWidth() / (float) Display.getHeight(),
            zNear, zFar);
      glMatrixMode(GL_MODELVIEW);
      glLoadIdentity();

      glEnable(GL_DEPTH_TEST);
      glEnable(GL_TEXTURE_2D);
      glEnable(GL_BLEND);
      glEnable(GL_ALPHA_TEST);
      glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
      glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
      glEnable(GL_CULL_FACE);
      glCullFace(GL_BACK);
      glEnable(GL_FOG);

      {
         FloatBuffer fogColours = BufferUtils.createFloatBuffer(4);
         fogColours.put(new float[] { fogColor.r, fogColor.g, fogColor.b,
               fogColor.a });
         glClearColor(fogColor.r, fogColor.g, fogColor.b, fogColor.a);
         fogColours.flip();
         glFog(GL_FOG_COLOR, fogColours);
         glFogi(GL_FOG_MODE, GL_LINEAR);
         glHint(GL_FOG_HINT, GL_NICEST);
         glFogf(GL_FOG_START, fogNear);
         glFogf(GL_FOG_END, fogFar);
         glFogf(GL_FOG_DENSITY, 0.005f);
      }

      int ceilingDisplayList = glGenLists(1);
      glNewList(ceilingDisplayList, GL_COMPILE);
      glBegin(GL_QUADS);
      glTexCoord2f(0, 0);
      glVertex3f(-gridSize, ceilingHeight, -gridSize);
      glTexCoord2f(gridSize * 10 * tileSize, 0);
      glVertex3f(gridSize, ceilingHeight, -gridSize);
      glTexCoord2f(gridSize * 10 * tileSize, gridSize * 10 * tileSize);
      glVertex3f(gridSize, ceilingHeight, gridSize);
      glTexCoord2f(0, gridSize * 10 * tileSize);
      glVertex3f(-gridSize, ceilingHeight, gridSize);
      glEnd();
      glEndList();

      int wallDisplayList = glGenLists(1);
      glNewList(wallDisplayList, GL_COMPILE);

      glBegin(GL_QUADS);

      glEnd();

      glEndList();

      int floorDisplayList = glGenLists(1);
      glNewList(floorDisplayList, GL_COMPILE);
      glBegin(GL_QUADS);
      glTexCoord2f(0, 0);
      glVertex3f(-gridSize, floorHeight, -gridSize);
      glTexCoord2f(0, gridSize * 10 * tileSize);
      glVertex3f(-gridSize, floorHeight, gridSize);
      glTexCoord2f(gridSize * 10 * tileSize, gridSize * 10 * tileSize);
      glVertex3f(gridSize, floorHeight, gridSize);
      glTexCoord2f(gridSize * 10 * tileSize, 0);
      glVertex3f(gridSize, floorHeight, -gridSize);
      glEnd();
      glEndList();

      int objectDisplayList = glGenLists(1);
      glNewList(objectDisplayList, GL_COMPILE);
      {
         double topPoint = 0.75;
         glBegin(GL_TRIANGLES);
         glColor4f(1, 1, 0, 1f);
         glVertex3d(0, topPoint, -5);
         glColor4f(0, 0, 1, 1f);
         glVertex3d(-1, -0.75, -4);
         glColor4f(0, 0, 1, 1f);
         glVertex3d(1, -.75, -4);

         glColor4f(1, 1, 0, 1f);
         glVertex3d(0, topPoint, -5);
         glColor4f(0, 0, 1, 1f);
         glVertex3d(1, -0.75, -4);
         glColor4f(0, 0, 1, 1f);
         glVertex3d(1, -0.75, -6);

         glColor4f(1, 1, 0, 1f);
         glVertex3d(0, topPoint, -5);
         glColor4f(0, 0, 1, 1f);
         glVertex3d(1, -0.75, -6);
         glColor4f(0, 0, 1, 1f);
         glVertex3d(-1, -.75, -6);

         glColor4f(1, 1, 0, 1f);
         glVertex3d(0, topPoint, -5);
         glColor4f(0, 0, 1, 1f);
         glVertex3d(-1, -0.75, -6);
         glColor4f(0, 0, 1, 1f);
         glVertex3d(-1, -.75, -4);

         glEnd();

         glColor4f(1, 1, 1, 1);
      }
      glEndList();

      getDelta();
      lastFPS = getTime();

      while (running) {
         glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

         int delta = getDelta();
         glBindTexture(GL_TEXTURE_2D, endTexture);

         glEnable(GL_CULL_FACE);
         glDisable(GL_DEPTH_TEST);
         glCallList(floorDisplayList);
         glCallList(ceilingDisplayList);
         glCallList(wallDisplayList);
         glEnable(GL_DEPTH_TEST);
         glDisable(GL_CULL_FACE);
         glBindTexture(GL_TEXTURE_2D, 0);
         glCallList(objectDisplayList);

         glLoadIdentity();
         glRotatef(rotationx, 1, 0, 0);
         glRotatef(rotationy, 0, 1, 0);
         glRotatef(rotationz, 0, 0, 1);
         glTranslatef(positionx, positiony, positionz);

      }
      if (resizable) {
         if (Display.wasResized()) {
            glViewport(0, 0, Display.getWidth(), Display.getHeight());
            glMatrixMode(GL_PROJECTION);
            glLoadIdentity();
            gluPerspective(fov, (float) Display.getWidth()
                  / (float) Display.getHeight(), zNear, zFar);
            glMatrixMode(GL_MODELVIEW);
            glLoadIdentity();
         }
      }
      if (printFPS) {
         updateFPS();
      }
      Display.update();
      if (vsync) {
         Display.sync(60);
      }
      if (Display.isCloseRequested()) {
         running = false;
      }
      while (!running) {
         glDeleteTextures(endTexture);
         // glDeleteLists(floorDisplayList, 1);
         // glDeleteLists(ceilingDisplayList, 1);
         // glDeleteLists(wallDisplayList, 1);
         // glDeleteLists(objectDisplayList, 1);
         Display.destroy();
         System.exit(0);
      }
   }
}


Main 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  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
107  
108  
109  
110  
111  
112  
113  
package com.game.Fearless;

import com.game.Fearless.Render;
import org.lwjgl.LWJGLException;
import org.lwjgl.Sys;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.DisplayMode;
import org.lwjgl.opengl.GLContext;
import org.lwjgl.util.vector.Vector3f;
import org.newdawn.slick.Color;

public class Fearless {

   public static final boolean resizable = false;
   public static volatile boolean running = true;
   public static Vector3f position = new Vector3f(0, 0, 0);
   public static Vector3f rotation = new Vector3f(0, 0, 0);
   public static float zNear = 0.00001f;
   public static final int gridSize = 100;
   public static final float tileSize = 0.4f;
   public static float zFar = 100000f;
   public static float fogNear = 120f;
   public static float fogFar = 100f;
   public static Color fogColor = new Color(0f, 0f, 0f, 1f);
   public static final boolean fullscreen = false;
   public static int walkingSpeed = 105;
   public static int mouseSpeed = 2;
   public static final boolean vsync = true;
   public static boolean printFPS = false;
   public static final int maxLookUp = 85;
   public static final int maxLookDown = -85;
   public static final float ceilingHeight = 200;
   public static final float floorHeight = -1;
   public static int fov = 100;
   private static int fps;
   public static long lastFPS;
   public static long lastFrame;
     
   protected static int getDelta() {
      long currentTime = getTime();
      lastFrame = getTime();
      int delta = (int) (currentTime - lastFrame);
      return delta;
   }

   public static long getTime() {
      return (Sys.getTime() * 1000) / Sys.getTimerResolution();
   }

   public static void updateFPS() {
      if (getTime() - lastFPS > 1000) {
         if (printFPS) {
            System.out.println("FPS: " + fps);
         }
         fps = 0;
         lastFPS += 1000;
      }
      fps++;
   }
   
   public void render() {
      Display.update();
      if (!Display.isCloseRequested()) {
         gameLoop();
      }
      Render.render();
   }

   private void gameLoop() {
      Fearless fearless;
      fearless = new Fearless();
      fearless.render();
   }

   public static void main(String[] args) {
      Fearless fearless;
      fearless = new Fearless();
      fearless.render();
      try {
         if (fullscreen) {
            Display.setDisplayModeAndFullscreen(Display
                  .getDesktopDisplayMode());
         } else {
            Display.setResizable(resizable);
            Display.setDisplayMode(new DisplayMode(800, 600));
         }
         Display.setTitle("Fearless Pre-Alpha 0.01");
         Display.setVSyncEnabled(vsync);
         Display.create();
      } catch (LWJGLException ex) {
         System.err.println("Display initialization failed.");
         System.exit(1);
      }

      if (fullscreen) {
         Mouse.setGrabbed(true);
      } else {
         Mouse.setGrabbed(false);
      }

      if (!GLContext.getCapabilities().OpenGL11) {
         System.err
               .println("Your OpenGL version doesn't support the required functionality.");
         Display.destroy();
         System.exit(1);
      }
      if (Display.isCloseRequested()) {
         Display.destroy();
         System.exit(1);
      }
   }
}

The best ideas will come from the weirdest and sometimes most f***'d up places, you just have to realize them.
Offline ReBirth
« Reply #12 - Posted 2012-04-25 02:49:23 »

After painfully read your code, I found that you call static methods getDelta, getTime and updateFPS of super-class from child-class. NO. Just make it "protected void blah()". You make it static when you want to call Fearless.getTime(). In inheritance, you also make instance of super-class.

Also there're duplicates code on your main and gameLoop

Offline deadteck

Senior Newbie





« Reply #13 - Posted 2012-04-25 03:02:59 »

After painfully read your code, I found that you call static methods getDelta, getTime and updateFPS of super-class from child-class. NO. Just make it "protected void blah()". You make it static when you want to call Fearless.getTime(). In inheritance, you also make instance of super-class.

Also there're duplicates code on your main and gameLoop
So i should make getTime, getDelta and updateFPS protected void ... , and what about the error I get about the static problems, or do i also put the Fearless.render  and Render.render method to protected Huh

The best ideas will come from the weirdest and sometimes most f***'d up places, you just have to realize them.
Offline ReBirth
« Reply #14 - Posted 2012-04-25 03:08:25 »

Depends on your need. Protected only provides access for child-class and itself. Read more about these access type. My google-fu shows
link1
link2

Offline deadteck

Senior Newbie





« Reply #15 - Posted 2012-04-25 21:07:01 »

Thanks a lot Grin

The best ideas will come from the weirdest and sometimes most f***'d up places, you just have to realize them.
Offline Danny02
« Reply #16 - Posted 2012-04-25 23:22:11 »

you know you can do
1  
import static org.lwjgl.opengl.GL11.*
Offline deadteck

Senior Newbie





« Reply #17 - Posted 2012-04-26 00:21:38 »

yea, I shouldve done that

The best ideas will come from the weirdest and sometimes most f***'d up places, you just have to realize them.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

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

The first screenshot will be displayed as a thumbnail.

Longarmx (49 views)
2014-10-17 03:59:02

Norakomi (38 views)
2014-10-16 15:22:06

Norakomi (31 views)
2014-10-16 15:20:20

lcass (35 views)
2014-10-15 16:18:58

TehJavaDev (65 views)
2014-10-14 00:39:48

TehJavaDev (65 views)
2014-10-14 00:35:47

TehJavaDev (55 views)
2014-10-14 00:32:37

BurntPizza (72 views)
2014-10-11 23:24:42

BurntPizza (43 views)
2014-10-11 23:10:45

BurntPizza (84 views)
2014-10-11 22:30:10
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

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