Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (499)
Games in Android Showcase (118)
games submitted by our members
Games in WIP (567)
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 / Networking & Multiplayer / Re: How can I make a new object for every player that joins on: 2012-11-22 14:41:46
Well, you should know when a player joins and then just spawn the object then?

Though that's a very sparse description of your problem, so it's kind of hard to help beyond what I just said, I think.
Ok, but I dont understand how to make a object in-game.
2  Game Development / Networking & Multiplayer / How can I make a new object for every player that joins on: 2012-11-22 14:06:47
How can I make a new object for every player that joins?
3  Java Game APIs & Engines / Engines, Libraries and Tools / Re: JarSplice doesnt work on: 2012-08-28 12:25:57
don't add slick.jar AND slick-util.jar only use one of them. In this case you'll likely only want slick.jar.

slick-util.jar is a subset of slick.jar so you'll have duplicate classes if you add both.
yes, it works now Smiley
4  Java Game APIs & Engines / Engines, Libraries and Tools / JarSplice doesnt work on: 2012-08-28 11:44:23
Hi,

When I will make a runnable jar with jarsplice I'll get a error:
Quote
Jar creation failed due to the following exception:
duplicate entry: org/newdawn/slick/Color.class

How I work:
1. I export the java project as a normal jar (not runnable)
2. I start up jarsplice and add Game.jar, lwjgl.jar(the real lwjgl libary not the slick lwjgl libary), slick.jar and slick-util.jar to step 1
3. I add the natives from lwjgl to step 3 (the natives from lwjgl are the same as the natives from slick(-util))
4. I add the mainclass + package to step 4 "Game.Mainclass" in my case
5. When I pressed on create fat jar I'll get the error

How do I fix this? I dont understand.

Thanks
5  Java Game APIs & Engines / Java 2D / Re: Follow player on: 2012-08-27 19:31:39
The map won't move anywhere - it's just getting drawn at a different place in reference to the visible screen area.
Ok, and whats the best option to do this? Somebody on google say with JPanels?
6  Java Game APIs & Engines / Java 2D / Re: Follow player on: 2012-08-27 19:23:10
By not wanting to move the whole level - what do you mean?

You're going to have to draw things at different places. Easiest is probably to just draw everything at an offset and have the offset determined either by the player or another camera object that solely exist to follow the player around.

1  
2  
3  
public void render(Graphics g, int hoff, int voff) {
   g.drawImage(sprite, x - hoff, y - voff);
}


Then by changing the hoff and voff values you can have the whole map shift in whatever direction you place. To follow  player for example.
A good example what I want is the same as a mario level. But I dont want move the whole level only the player and the camera.
7  Java Game APIs & Engines / Java 2D / Follow player on: 2012-08-27 17:50:39
Hi,

Again a question from me. Ive made a level from 2500*2500. But now I have a problem, Ive searched at google but didnt found a good explain. How can I make that the camera is following the player? (I dont want moving the whole level)

Thank you in advance!

N1els5
8  Java Game APIs & Engines / Java 2D / Re: Problem with loading resources on: 2012-08-27 10:21:54
It, works! Thank you! Grin
9  Java Game APIs & Engines / Java 2D / Re: Problem with loading resources on: 2012-08-27 10:12:56
Hi!
Try this:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
try {
            logo = TextureLoader.getTexture("PNG", new FileInputStream(new File("res/logo.png")));
            menu_start = TextureLoader.getTexture("PNG", new FileInputStream(new File("res/menu_start.png")));
            menu_exit = TextureLoader.getTexture("PNG", new FileInputStream(new File("res/menu_exit.png")));
            stone = TextureLoader.getTexture("PNG", new FileInputStream(new File("res/stone.png")));
            background = TextureLoader.getTexture("PNG", new FileInputStream(new File("res/background.png")));
            grass = TextureLoader.getTexture("PNG", new FileInputStream(new File("res/grass.png")));
            carpet = TextureLoader.getTexture("PNG", new FileInputStream(new File("res/carpet.png")));
            player = TextureLoader.getTexture("PNG", new FileInputStream(new File("res/player.png")));
        } catch (IOException ex) {
            Logger.getLogger(textureLoader.class.getName()).log(Level.SEVERE, null, ex);
        }


Put that in you`re texture loader! Hope it helps!
Replace
1  
leaves = TextureLoader.getTexture("PNG", ResourceLoader.getResourceAsStream("blocks/leaves.png"));

with
1  
leaves = TextureLoader.getTexture("PNG", new FileInputStream(new File("blocks/leaves.png")));
.
Do the same to every texture!
No, I'll get the same error:
Quote
Exception in thread "main" java.lang.NullPointerException
   at Lost.Adventure.WorldGenBasic.build(WorldGenBasic.java:198)
   at Lost.Adventure.Mainclass.start(Mainclass.java:50)
   at Lost.Adventure.Mainclass.ask(Mainclass.java:93)
   at Lost.Adventure.Mainclass.main(Mainclass.java:68)
10  Java Game APIs & Engines / Java 2D / Re: Problem with loading resources on: 2012-08-27 10:02:12
Hmm try refreshing your project? right click -> refresh.

Or try what ra4king said and remove the 'blocks/' part and see if that works.
Nope, both don't work
11  Java Game APIs & Engines / Java 2D / Re: Problem with loading resources on: 2012-08-27 09:15:51
Thank you for your response, but I donĀ“t understand it (Im a noob in resources I've never worked with it before Roll Eyes)

This is a picture of my buildpath:

I think the resource folder isn't excluded by default?
12  Java Game APIs & Engines / Java 2D / Re: Problem with loading resources on: 2012-08-27 08:47:06
Hi,

Thanks for your reaction. Now I've added the blocks folder into the resources folder and add the resources folder to the buildpath. But he doesn't work, I'll get the same error.
13  Java Game APIs & Engines / Java 2D / Problem with loading resources on: 2012-08-26 15:23:36
Hey,

Im making a game with slick and lwjgl only I've got this error:
Quote
Exception in thread "main" java.lang.NullPointerException
   at Lost.Adventure.WorldGenBasic.build(WorldGenBasic.java:198)
   at Lost.Adventure.Mainclass.start(Mainclass.java:45)
   at Lost.Adventure.Mainclass.main(Mainclass.java:78)

From this piece of code:
1  
stone.bind();


This is how I load the textures:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
static Texture stone;
   static Texture dirt;
   static Texture grass;
   static Texture log;
   static Texture leaves;
   public void init() throws IOException
   {
      try {
      stone = TextureLoader.getTexture("PNG", ResourceLoader.getResourceAsStream("blocks/stone.png"));
      dirt = TextureLoader.getTexture("PNG", ResourceLoader.getResourceAsStream("blocks/dirt.png"));
      grass = TextureLoader.getTexture("PNG", ResourceLoader.getResourceAsStream("blocks/grass.png"));
      log = TextureLoader.getTexture("PNG", ResourceLoader.getResourceAsStream("blocks/log.png"));
      leaves = TextureLoader.getTexture("PNG", ResourceLoader.getResourceAsStream("blocks/leaves.png"));
      } catch (IOException e) {
         e.printStackTrace();
      }
   }


And this is my workspace:

Project -> scr -> Lost.adventure -> WorldGenBasic.java (java files)
Project -> blocks -> stone.png (resources)

How does I fix this error?

Thank you in advance! Smiley
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.

Pippogeek (38 views)
2014-09-24 16:13:29

Pippogeek (29 views)
2014-09-24 16:12:22

Pippogeek (18 views)
2014-09-24 16:12:06

Grunnt (42 views)
2014-09-23 14:38:19

radar3301 (24 views)
2014-09-21 23:33:17

BurntPizza (61 views)
2014-09-21 02:42:18

BurntPizza (31 views)
2014-09-21 01:30:30

moogie (36 views)
2014-09-21 00:26:15

UprightPath (49 views)
2014-09-20 20:14:06

BurntPizza (53 views)
2014-09-19 03:14:18
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!