Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (539)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (603)
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  Game Development / Newbie & Debugging Questions / Re: OpenGL - glClear() not clearing... possibly on: 2013-12-18 11:20:07
Does removing GL_DEPTH_BUFFER from your clear call fix it?

it does! Why would that be? I know its not atm. but it might be necessary in the future to use 3D space.

EDIT: is it because I'm using glVertex2f in a depth space? If I used glVertex3f with any old z component this wouldn't have happened would it?
2  Game Development / Newbie & Debugging Questions / Re: OpenGL - glClear() not clearing... possibly on: 2013-12-14 17:58:06
Yes, unless you're using display lists (which upload the data once to the GPU), the you will need to call glBegin and end every frame. The other thing you could do, which would probably be better to do, would be to use glTranslatef and move your vertices instead of creating a new quad every frame.

right, I didn't think about that, I made my own Vector engine you see, so I thought I would relate my own vectors to that ^ current system. But unless I want to do a lot of background openGL work, I think that would be a good idea XD.
3  Game Development / Newbie & Debugging Questions / OpenGL - glClear() not clearing... possibly on: 2013-12-14 17:51:39
I'm trying to animate a quad in 2D space that has a texture applied to it, but its as if its not clearing (glClear is DEFINITELY being called before each render) or maybe its making a new quad each time, I don't know.

anyway, instead of a moving square, I get this:



here is my run() method:

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  
private void run() {
      isRunning = true;

      int frames = 0;
      long frameCounter = 0;

      final double frameTime = 1.0 / FRAME_CAP;

      long lastTime = Time.getTime();
      double unprocessedTime = 0;

      while (isRunning) {

         boolean render = false;

         long startTime = Time.getTime();
         long passedTime = startTime - lastTime;
         lastTime = startTime;

         unprocessedTime += passedTime / (double) Time.SECOND;
         frameCounter += passedTime;

         while (unprocessedTime > frameTime) {
            render = true;
            unprocessedTime -= frameTime;

            if (Window.isCloseRequested()) {
               stop();
            }

            Time.setDelta(frameTime);
            Input.update();

            game.input(); // IMPORTANT
            game.update(); // IMPORTANT

            if (frameCounter >= Time.SECOND) {
               System.out.println(frames);
               frames = 0;
               frameCounter = 0;
            }
         }

         if (render) {
            render(); // IMPORTANT
            frames++;
         } else {
            try {
               Thread.sleep(1);
            } catch (InterruptedException e) {
               e.printStackTrace();
            }
         }
      }

      cleanUp();
   }


here is my RenderUtil class, which contains static methods such as clearScreen() and initGraphics():

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
public static void clearScreen(){
      glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER); //Although it is 2D, I might want to add some depth later on ;)
   }
   
   public static void initGraphics(int WIDTH, int HEIGHT){
      glClearColor(1.0f, 0.0f, 0.0f, 0.0f);
     
      glMatrixMode(GL_PROJECTION);
      glLoadIdentity();
      glOrtho(0, WIDTH, 0, HEIGHT, 1, -1);
      glMatrixMode(GL_MODELVIEW);
      glEnable(GL_TEXTURE_2D);
   }
   
   public static String getOpenGLVersion(){
      return glGetString(GL_VERSION);
   }


and here is what I do in render():

1  
2  
3  
4  
5  
6  
private void render() {
      clearScreen();
      game.render();
      Window.render(); // quite simply, Display.update();

   }

this is a part of my Game class
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
public void render(){
      sprite.render();
   }
   
   public void update(){
      if (Input.getKey(Input.KEY_A)){
         sprite.setPos(sprite.getPos().getX() - 0.25f, sprite.getPos().getY());
      }
      if (Input.getKey(Input.KEY_D)){
         sprite.setPos(sprite.getPos().getX() + 0.25f, sprite.getPos().getY());
      }
      if (Input.getKey(Input.KEY_S)){
         sprite.setPos(sprite.getPos().getX(), sprite.getPos().getY() - 0.25f);
      }
      if (Input.getKey(Input.KEY_W)){
         sprite.setPos(sprite.getPos().getX(), sprite.getPos().getY() + 0.25f);
      }


And crucially, the actual rendering, the Sprite 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  
private Vector2f pos;
   private int size;
   
   //which animation the sprite has
   private int i;
   private int j;
   
   private Texture texture;
   
   public Sprite(String name, int size){
      i = 0;
      j = 0;
      this.size = size;
      pos = new Vector2f(0,0);
     
      try{
         texture = TextureLoader.getTexture("PNG", new FileInputStream(new File("res/" + name + ".png")));
      } catch (IOException e){
         e.printStackTrace();
      }
     
   }
   
   public void render(){
     
                //IMPORTANT
                //should I be doing glBegin --coordinate stuff-- glEnd every render()?

      texture.bind();
     
      glBegin(GL_QUADS);

                // this is just a bit of square math to determine which tile of a spritesheet the quad should display.
     
         //BL
         glTexCoord2f(i * 0.25f, (j+1) * 0.25f);
//         glTexCoord2f(0, 1); of the tile
         glVertex2f(pos.getX(), pos.getY());
         //BR
         glTexCoord2f((i+1) * 0.25f, (j+1) * 0.25f);
//         glTexCoord2f(1,1); of the tile
         glVertex2f(pos.getX() + size, pos.getY());
         //TR
         glTexCoord2f((i+1) * 0.25f, j * 0.25f);
//         glTexCoord2f(1,0); of the tile
         glVertex2f(pos.getX() + size, pos.getY() + size);
         //TL
         glTexCoord2f(i * 0.25f, j * 0.25f);
//         glTexCoord2f(0,0); of the tile
         glVertex2f(pos.getX(), pos.getY() + size);
         
      glEnd();

   }
   
   public Vector2f getPos(){
      return pos;
   }
   
   public void setPos(Vector2f r){
      pos = r;
   }
   
   public void setPos(float x, float y){
      pos.setX(x);
      pos.setY(y);
   }

   public int getI() {
      return i;
   }

   public void setI(int i) {
      this.i = i;
   }

   public int getJ() {
      return j;
   }

   public void setJ(int j) {
      this.j = j;
   }



so when rendering my "sprite" should I be doing glBegin --coordinates-- glEnd every render cycle? Does this create an entirely new quad as well as the old one? that's the only possible problem that I can see.
4  Game Development / Game Mechanics / Re: Which is faster: large pre-scaled images or small scaled images on: 2013-12-13 17:17:42
why would you think that both would use the same amount of memory??

Also, the textures are not scaled on your GPU they are sampled. The processing time is independent of the scale of the texture.

well, I imagined that, once scaled up, the data would be the same size as data that was pre-scaled, as it is being displayed on the screen in the same size as the pre-scaled. So by sampling I do not effect performance in ANY way?
5  Game Development / Game Mechanics / Which is faster: large pre-scaled images or small scaled images on: 2013-12-12 17:03:44
I'm trying to start a 2d opengl game, and I have 2 choices for sprite textures that are loaded onto quads (that I can see): make a texture in PS and scale it up with "nearest neighbour" and load it in; Or load in the small texture and do blending with these two lines of code:

glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);

My thinking is that both ways the texture would take up the same amount of VRAM, but the second way would require more processing power (during game execution, that is, albeit not that much). Do you agree with me?
6  Games Center / Showcase / Re: Conway's Game of Life! 1.2 on: 2013-09-24 19:15:04
The rules for Life can actually be expressed more simply:

A live cell with two neighbors stays live.
A live or dead cell with three neighbors is live.
All other cells are dead.

This turns into a one-liner (where a cell is a boolean):
cell = neighbors == 3 || cell && (neighbors == 2);








hmm that's probably simpler to explain to a player too though... XD
7  Games Center / Showcase / Re: Conway's Game of Life! 1.2 on: 2013-09-24 19:07:36
The rules for Life can actually be expressed more simply:

A live cell with two neighbors stays live.
A live or dead cell with three neighbors is live.
All other cells are dead.

This turns into a one-liner (where a cell is a boolean):
cell = neighbors == 3 || cell && (neighbors == 2);



I know, I found that out when coding, but the rules on the wiki, i.e the rules that would be explained to a player, are in the main post ^
8  Games Center / Showcase / Re: Conway's Game of Life! 1.2 on: 2013-09-23 18:49:27
forgot about a picture XD, got it now!
9  Games Center / Showcase / Conway's Game of Life! 1.2 on: 2013-09-23 18:40:14
After I saw Conway's game of life on Dara Ó Briain's maths club, I knew then and there that that would be good for my first solo program. After a bit of help with my malfunctioning code from some VERY kind people...
here: http://www.java-gaming.org/topics/an-array-index-out-of-bounds-exception-i-know-what-that-means-but-why/30036/msg/278077/view.html#msg278077

I made...



THE GAME OF LIFE:
Conway's game of life is a game that consists of an orthographic grid of cells that can be "alive" or "dead"; it is built on 4 simple rules:
/*
    *Live cells with fewer than two live neighbours die.
    *Live cells with two or three neighbours live on.
    *Live cells with more than three neighbours die.
    *Dead cells with two or three live neighbours become live.
*/

it can be quite fun to build contraptions (or societies if you like..) of your own, but one problem with this version is that the window is relatively tiny and there is no option to move the viewing pane. (I could change that but it would take a lot of effort on my part XD)

DOWNLOADS:

1.2 (i.e. adds optional game speeds and cell set up instead of initializing the cells from code)
here: http://www.mediafire.com/download/4ro1aja74tgkics/game_of_life_1_2.zip

CONTROLS:
- use the mouse and left click to turn on/ turn off a cell.
- change the game speed (BEFORE activating) using shift/control
- use enter to activate and watch your simulation.

TESTING:
- if anyone can be bothered, test a glider http://www.google.co.uk/imgres?imgurl=http://upload.wikimedia.org/wikipedia/en/d/d0/Game_of_life_animated_glider_2.gif&imgrefurl=http://en.wikipedia.org/wiki/Wikipedia:Featured_picture_candidates/Game_of_Life_glider&h=336&w=336&sz=44&tbnid=0KHI2rB7-nhTeM:&tbnh=91&tbnw=91&zoom=1&usg=__znNp1_Tq1OWAyAAgC3Ba5vCYPQk=&docid=UttFrzpPxFTobM&sa=X&ei=DYtAUtzoIsG50QWhzYGYCA&ved=0CEsQ9QEwBA for long enough that it could have exited the map (around 229 cells away) I would be very greatful. If nothing breaks GREAT! if it does however, post up the error message (if there is one?).
10  Game Development / Newbie & Debugging Questions / Re: An array index out of bounds exception, I know what that means but.. why!? on: 2013-07-16 16:49:11
OK I'm being silly it extends canvas so it can use things like the mouse and bufferstrategies, how would I use the requestFocus() on the Canvas then?
11  Game Development / Newbie & Debugging Questions / Re: An array index out of bounds exception, I know what that means but.. why!? on: 2013-07-16 16:46:24
call requestfocus() on the canvas

The class with main in it, "Game", extends canvas and never actually uses it anywhere else. Should it be on the JFrame instead? because that doesn't work.   Huh
12  Game Development / Newbie & Debugging Questions / Re: An array index out of bounds exception, I know what that means but.. why!? on: 2013-07-15 18:19:10
I have a key listener, listening for: enter, shift and control. The window IS the active window upon startup, but before the keyListener can actually pick up anything I have to click the canvas (inside the borders).
13  Game Development / Newbie & Debugging Questions / Re: An array index out of bounds exception, I know what that means but.. why!? on: 2013-07-15 18:04:32
ONE final problem, I'm sure it can be fixed with one line of code. How do I make it so that the keyboard automatically works without me having to click in the window?
14  Game Development / Newbie & Debugging Questions / Re: An array index out of bounds exception, I know what that means but.. why!? on: 2013-07-15 18:02:18
Be grateful there are examples. If you start using a library like libGDX you're going to find a lot less and more inconsistent examples, if they exist at all. Oracle has done a pretty good job with their documentation and tutorials, but in the end it's up to you to implement whatever you need. If the Oracle examples confuse you, use Google and find another one, not that complicated.

No doubt it IS actually useful in more advanced stages, but for a beginner like me?  Undecided
I could go on youtube tutorials, and that is what I've done up until now, but I don't want to follow a tutorial f you know what I mean.
15  Game Development / Newbie & Debugging Questions / Re: An array index out of bounds exception, I know what that means but.. why!? on: 2013-07-07 18:03:45
well, thank you for the help I guess,  Grin I fixed the logic problem by simply saying if the cell I'm checking is true, take away one from the number of surrounding cells. And now, I have my very own Game of life!

With a debugger you should be able to make sense of even the most obtuse code.
Stick a break point on the Exception in question, and investigate the state of all the relevant variables at the point the error occurs.

That said, if you can't understand your own code, what chance do others have?

Always endeavor to write code that'll be understandable to others, and yourself 6 months down the line!

Try telling that to the people who make examples in the official oracle documentation. If I could understand what they wrote, I'm sure I'd come to forums less often  Undecided

16  Game Development / Newbie & Debugging Questions / Re: An array index out of bounds exception, I know what that means but.. why!? on: 2013-07-05 18:04:19
The code as it stands is not so clear. Evidence: there's a bug and it is not easy to spot right away. So, I'd try and do things in a way that makes what is going on more explicit.

One idea is that since you have special cases with your algorithm when you are on an edge, try making the edges more obvious.

1  
2  
3  
4  
    int leftEdge = 0;
    int rightEdge = pWidth - 1;
    int topEdge = 0;
    int bottomEdge = pHeight - 1;

Now, use these values to assign your x1, x2, y1, y2. All in all pretty verbose, but I think it might help make OBO errors (off-by-one errors) easier to spot.

But maybe a better alternative would be to make the edge-condition test part of the for loop. Then you don't have the "complication" of building different for-loops.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
for (int j = y-1; j <= y+1; y++)
{
    for (int i = x-1; i <= x+1: x++)
    {
        if (( i >= 0 ) && ( i < pWidth ) && ( j >= 0 ) && ( j < pHeight )
                && ( i != x && j != y) )
        {
            if ( pCell[j + i * pWidth] ) n++;
        }
    }
}


Is that better? I'm not sure. But at least the edge case tests are all grouped together. And the "qualifying tests" are separated from the counting test. The "qualifying" tests could also then be further consolidated.
1  
2  
3  
4  
    boolean isWithinP(int x, int y)
    {
         return ( x >= 0 ) && ( x < pWidth ) && ( y >= 0 ) && ( y < pHeight );
    }

Then, the qualifying-to-be-counted test becomes:

1  
    if (isWithinP(i, j) &&  i != x && j != y) )


Just some ideas...a lot of what determines what code is easiest to read is in the eye of the beholder and the context. The function isWithinP() is also easy to Unit Test.

yeah, organising it did fix the silly AIOOB but it still cant detect when there is a live cell on the same X or Y as the middle, it still only picks up the corners. The logic looks perfect (this is following both mine and yours). If its inside(j, i) AND i does not equal y AND j does not equall X, whats wrong with that!? It skips the line entirely if i = y OR j = x, instead of AND.
1  
if(isInside(j,i) && ((j != x) && (i != y)))
17  Game Development / Newbie & Debugging Questions / Re: An array index out of bounds exception, I know what that means but.. why!? on: 2013-07-04 22:47:19
wrong quote XD
18  Game Development / Newbie & Debugging Questions / Re: How do I start making games with graphics? on: 2013-07-04 22:34:58
I like thechernoproject on youtube, he is doing a very long tutorial of a "realm of the mad god" type game, and I believe he will go into networked multiplayer in the future.
19  Game Development / Newbie & Debugging Questions / Re: An array index out of bounds exception, I know what that means but.. why!? on: 2013-07-04 22:31:30
So my code here checks the "neighbourhood" of a cell, my cells are simply an array of Booleans [34 * 24] a total of 816.
When I run this 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  
public void function(int x, int y){
      int n = 0;
      int x1 = 0, x2 = 0, y1 = 0, y2 = 0;
      if(x == 0){
         x1 = x;
         x2 = x + 1;
      }
      if(x == pWidth){
         x1 = x - 1;
         x2 = x;
      }
      if(y == 0){
         y1 = y;
         y2 = y + 1;
      }
      if(y == pHeight){
         y1 = y - 1;
         y2 = y;
      }
      if(x != 0 && x != pWidth && y != 0 && y != pHeight){
         x1 = x - 1;
         x2 = x + 1;
         y1 = y - 1;
         y2 = y + 1;
      }
         
      for(int i = y1; i <= y2; i++){
         for(int j = x1; j <= x2; j++){
            if(pCell[j + i * pWidth] == true && j != x && i != y) n++;
         }
      }
}


I get an array index out of bounds.... on line 29 (where it looks at the array given its position) and the value after says: 816, the length of the array.

All of those if statements at the top are to make sure I don't get an array exception (for instance, by it checking the squares above and around 0,0) . pWidth and pHeight are the width and height of pCell (the array of Booleans 816 entries long). What do you see wrong? anything?

that's an idea, I'm sure I would get the last value thing eventually, but since I've never done this before its not obvious. I don't really know how to make eclipse track variables in debug mode, I find them sometimes when the variables are part of the line that gives the error, but it would be really helpful if I could know what all the variables are. Is that possible?
I tried this condition loop before and it was even longer, if statements everywhere, this is my shortest one Cheesy ill try some of what you said.
20  Game Development / Newbie & Debugging Questions / Re: What is a Sample? (Samplemodel - BufferedImage) on: 2013-07-04 19:25:31
If you go on youtube to: http://www.youtube.com/user/TheChernoProject see his game programming series, if you are up to understanding the jargon, well done you can learn it, if not even then you can still copy his code and it will work. That's how I started and now I make my own things with a lot of what he said in mind.
21  Game Development / Newbie & Debugging Questions / Re: An array index out of bounds exception, I know what that means but.. why!? on: 2013-07-04 19:21:22
I think your algorithm gets in trouble when you check if x = pWidth and y = pHeight. If your pixel array is of width pWidth and height pHeight, then you probably want to make your leftside check if (x == pWidth-1) and your bottomside check if (y == pHeight-1).

There's a couple more changes that will be needed as a result of this change, but I think you will see them.

right that makes sense Smiley (so how do I check the last one!? I added an if statement so it basically skips the last one, but I really don't want it to do that. So what is this fix that I was supposed to find obvious?)

also... I don't want the check to count the cell(x,y), only the cells AROUND (x,y). So to stop that I added some logic to the check part.
1  
2  
3  
4  
5  
6  
7  
for(int i = y1; i <= y2; i++){
         for(int j = x1; j <= x2; j++){
            if(x != 33 && y != 23){
               if(pCell[j + i * pWidth] && (j != x) && (i != y)) n++;
            }
         }
      }


now to me this says that when the cell is true AND (x does not equal the middle cell's x AND y does not equal the middle cell's y) ... so every time except when the co-ordinates are directly ON the middle cell. But instead whenever there is a true cell on the same X as the middle or the same Y it returns false, only when there are true cells in the corners does it work (I made it to the game of life rules (myself) if you must know)

after this I just need to make the keyboard work, oh god. D:
22  Game Development / Newbie & Debugging Questions / An array index out of bounds exception, I know what that means but.. why!? on: 2013-07-02 20:40:17
So my code here checks the "neighbourhood" of a cell, my cells are simply an array of Booleans [34 * 24] a total of 816.
When I run this 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  
public void function(int x, int y){
      int n = 0;
      int x1 = 0, x2 = 0, y1 = 0, y2 = 0;
      if(x == 0){
         x1 = x;
         x2 = x + 1;
      }
      if(x == pWidth){
         x1 = x - 1;
         x2 = x;
      }
      if(y == 0){
         y1 = y;
         y2 = y + 1;
      }
      if(y == pHeight){
         y1 = y - 1;
         y2 = y;
      }
      if(x != 0 && x != pWidth && y != 0 && y != pHeight){
         x1 = x - 1;
         x2 = x + 1;
         y1 = y - 1;
         y2 = y + 1;
      }
         
      for(int i = y1; i <= y2; i++){
         for(int j = x1; j <= x2; j++){
            if(pCell[j + i * pWidth] == true && j != x && i != y) n++;
         }
      }
}


I get an array index out of bounds.... on line 29 (where it looks at the array given its position) and the value after says: 816, the length of the array.

All of those if statements at the top are to make sure I don't get an array exception (for instance, by it checking the squares above and around 0,0) . pWidth and pHeight are the width and height of pCell (the array of Booleans 816 entries long). What do you see wrong? anything?
23  Game Development / Newbie & Debugging Questions / Re: Can someone tell me how to make a screen that I can use! on: 2013-06-17 18:55:52
Uurgh, I'm just scrapping this 2d array for now and going with the 1D. I just made a function setPixel(x, y, col) to do the whole "Cartesian" thing. thanks for the help anyway!  Grin
24  Game Development / Newbie & Debugging Questions / Re: Can someone tell me how to make a screen that I can use! on: 2013-06-17 18:24:58
wait, why am I doing the first conversion? I don't need to do that! All I need to do is the second conversion  Roll Eyes because I don't need to know what it looked like the render before, if you know what I mean.
25  Game Development / Newbie & Debugging Questions / Re: Can someone tell me how to make a screen that I can use! on: 2013-06-17 17:52:50
I also want it layed out so I can put in x and y co ordinates, I think the current setup means I have to input (y, x) instead of (x, y)
26  Game Development / Newbie & Debugging Questions / Re: Can someone tell me how to make a screen that I can use! on: 2013-06-17 17:51:28
Maybe I should be more helpful to you all.
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
      pixel = new int[height][width];
     
      //1D pixelData to 2D pixel (for cartesian coordinates)
      for (int i = 0; i < height; i++){
         for(int j = 0; j < width; j++){
            pixel[i][j] = pixelData[i*j];
         }
      }
     
      //pixel changes go here.
      pixel[30][60] = 0xCC0000;
     
      //flatten back to pixelData
      for(int i = 0; i < pixel.length;i++){
         for(int j = 0; j < pixel[i].length; j++){
            pixelData[i*j] = pixel[i][j];
         }
      }


I did a bit more, figured it out and I am able to change pixels by simply going pixelData
  • = etc. But now this has come up.

this is where my problem lies. I want to convert the 1D array from the bufferstrategy into a 2D Cartesian array (for ease of use), and then input my 2D stuff back into the 1D pixelData but you see when I change the pixel[30][60] to 0xCC0000 (or any coordinate/colour) it doesn't work, nothing shows except the black default. I know this lies in the array but that's where my brain shuts down on me Smiley
27  Game Development / Newbie & Debugging Questions / Re: Can someone tell me how to make a screen that I can use! on: 2013-06-17 17:10:41
I have, for quite some bloody time I might add.  Clueless  But still I don't want you to make it for me (if you do it is helpful though), I want a link maybe to a useful website, or more importantly.. how on earth do I interact with my screen I just made, how do I put stuff on it, explanations.
thankyou.
28  Game Development / Newbie & Debugging Questions / Can someone tell me how to make a screen that I can use! on: 2013-06-14 14:18:22
I have an overly long and complicated code that I was going to use for a game, but the first part, getting the screen to do something! Can someone show me the code for a simple screen (frame) that also renders the data given to it? If you know what I mean? If I could get this out the way I can move on and input things to the screen without hassle!

the width is 450
the height is 450 / 16 * 9

HALP
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.

rwatson462 (37 views)
2014-12-15 09:26:44

Mr.CodeIt (30 views)
2014-12-14 19:50:38

BurntPizza (61 views)
2014-12-09 22:41:13

BurntPizza (98 views)
2014-12-08 04:46:31

JscottyBieshaar (59 views)
2014-12-05 12:39:02

SHC (74 views)
2014-12-03 16:27:13

CopyableCougar4 (77 views)
2014-11-29 21:32:03

toopeicgaming1999 (138 views)
2014-11-26 15:22:04

toopeicgaming1999 (127 views)
2014-11-26 15:20:36

toopeicgaming1999 (38 views)
2014-11-26 15:20:08
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

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