Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (536)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / Engines, Libraries and Tools / Re: [LibGDX] NullPointerException and batch on: 2013-05-27 17:57:18
I fix my problem !
Appently my inititalization wasn't good
Thx for the help
2  Java Game APIs & Engines / Engines, Libraries and Tools / [LibGDX] NullPointerException and batch on: 2013-05-27 01:29:43
Hi  Grin

I'm trying to make a simple tile mapping but I have a problem with the rendering. I have a NullPointer exception Sad

1  
2  
3  
Caused by: java.lang.NullPointerException
   at Map.render(Map.java:51)
   at .render(LabC.java:47)


I use 3 classes :
- Block => Each Tile
- Map => two dimensional "Block" array
- LabC => The main class

For rendering one Block I use this function:

Block.java:

1  
2  
3  
4  
public void render(){
// "sprite" is a Sprite object for Texture, position ... of the Tile.
     sprite.draw(LabC.batch);
   }


To display all tiles I use this function:
Map.java
1  
2  
3  
4  
5  
6  
7  
public void render(){
      for(int y = 0;y < map.length; y++){
         for(int x =0;x < map[1].length; x++){
            blockmap[x][y].render();
         }
      }
   }


And the render method :

LaboC.java

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
public static SpriteBatch batch;
...
public void render() {      
      Gdx.gl.glClearColor(0, 0, 0, 1);
      Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
      batch.setProjectionMatrix(camera.combined);
     
      batch.begin();
      test.render();
//"test" is a Map object
     batch.end();
   }


Thx for the help
3  Java Game APIs & Engines / OpenGL Development / Re: [LWJGL] Color problem when I load a Texture ... on: 2013-03-07 22:55:45
Longarmx --> Too late :p

davedes  -> I try to make a Texture class but I don't understand how to bind the texture.
I am stuck here:

http://pastebin.java-gaming.org/ff913735f49
4  Java Game APIs & Engines / OpenGL Development / Re: [LWJGL] Color problem when I load a Texture ... on: 2013-03-06 22:43:09
Ok thx !

But why my color is stange whereas I just try to load a Texture(without displaying it) ?
5  Java Game APIs & Engines / OpenGL Development / Re: [LWJGL] Color problem when I load a Texture ... on: 2013-03-06 22:13:18
Sorry  Cheesy I forget to clean my code so it's a simplier code :

http://pastebin.java-gaming.org/2fff9515343

Square Class:

http://pastebin.java-gaming.org/fff9163534f

When I don't load a texture:



When I load one:



Thank Smiley
6  Java Game APIs & Engines / OpenGL Development / [LWJGL] Color problem when I load a Texture ... on: 2013-03-04 15:42:04
Hi,

When I try to load a Texture with slick-util, colors changes without any reasons...

Example :



Code:

http://pastebin.java-gaming.org/26a65025f4f

Thank for your help Smiley


Sorry  Cheesy I forget to clean my code so it's a simplier code :

http://pastebin.java-gaming.org/2fff9515343

Square Class:

http://pastebin.java-gaming.org/fff9163534f

When I don't load a texture:



When I load one:



Thank Smiley
7  Game Development / Newbie & Debugging Questions / Re: Avoid multiple inputs ? on: 2012-10-07 17:39:34
Thx a lot  Grin
8  Game Development / Newbie & Debugging Questions / Avoid multiple inputs ? on: 2012-10-07 17:37:21
Hi !

First excuse me for my bad English level  Grin
I'm trying to make a RPG  with Slike2D, so I want my player can only move on the x and the z axis, but with this code:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
    public void update(GameContainer gc, int delta) throws SlickException
    {
        Input input = gc.getInput();
        if(input.isKeyDown(Input.KEY_S))
        {
          player.Down();
        }
 
        if(input.isKeyDown(Input.KEY_Q))
        {
            player.Left();
        }
}

 
I can move him diagonally with S and Q for example  Sad

Any solutions to remove this features ?
Thx
Pages: [1]
 

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

The first screenshot will be displayed as a thumbnail.

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

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

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

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

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

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

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

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

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

Riven (31 views)
2014-07-23 20:56:16
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!