Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (581)
games submitted by our members
Games in WIP (500)
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  Games Center / Featured Games / Re: Revenge of the Titans on: 2011-06-27 13:40:07
Congrats on getting "featured" by the Yogscast!
Cheesy
2  Game Development / Newbie & Debugging Questions / Re: threadpool on: 2011-06-17 20:08:19
There is no main method in ur code.
Thats what the error says.
3  Game Development / Newbie & Debugging Questions / Re: Playing music in java on: 2011-06-15 00:43:18
Ok thank you its working now.
4  Game Development / Newbie & Debugging Questions / Re: Playing music in java on: 2011-06-14 14:39:23
ok i made my folderstructure like you suggested.
thx 4 everyones help!

but as soon as this works the next question pops up:

now when i e.g. jump the sound only plays the first time.
what do i have to do so the sound plays every time?

i tried something like:

1  
2  
3  
4  
5  
      if(jump.isRunning()) //jump.isActive()
     {
         jump.stop();
      }
      jump.start();


but it wont work.

anybody got ideas?
5  Game Development / Newbie & Debugging Questions / Re: Playing music in java on: 2011-06-14 11:34:19
1  
2  
3  
4  
5  
         System.out.println(getClass().getResource(".").getPath());
         System.out.println(getClass().getResource("./Level.class").getPath());
         System.out.println(getClass().getResource("../sounds/jump.wav").getPath());
         System.out.println(getClass().getResource(".././sounds/jump.wav").getPath());
         System.out.println(getClass().getResource("..").getPath());


only line 1 and 2 work.
what am i doing wrong?

Moep
6  Game Development / Newbie & Debugging Questions / Re: Playing music in java on: 2011-06-14 10:29:56
Ok now i found the problem.

1  
2  
         URL url = getClass().getResource(".");
         System.out.println(url.getPath());

the output is:
/C:/Users/Wolfe/Eclipse/Game%200.15/bin/

The sounds folder is in the Game 0.15 folder so i have to move up one folder via relative path.
Ive googled for 1/2 hour now and i cant seem to find it.
How is it done?

ps: its really annoying that ".." doesnt work-.-

Moep
7  Game Development / Newbie & Debugging Questions / Re: Playing music in java on: 2011-06-14 00:09:40
dont know if i understood it right, but if i write it like that:

1  
2  
3  
4  
5  
         jump.open(
               AudioSystem.
               getAudioInputStream(
                     getClass().
                     getResource(myRoot + "./sounds/jump.wav")));

i get the exception at line 3.

The whole exception message is this:

java.lang.NullPointerException
   at com.sun.media.sound.WaveFileReader.getAudioInputStream(Unknown Source)
   at javax.sound.sampled.AudioSystem.getAudioInputStream(Unknown Source)
   at MusicList.init(MusicList.java:32)
   at MusicList.<init>(MusicList.java:21)
   at GameFrame.<init>(GameFrame.java:82)
   at GameApp.main(GameApp.java:7)

Moep
8  Game Development / Newbie & Debugging Questions / Re: Playing music in java on: 2011-06-13 19:17:16
Thx 4 the tip but i keep getting a NullPointerException and i dont know why:

1  
2  
3  
         jump = AudioSystem.getClip();
         File f = new File(myRoot + "./sounds/jump.wav");
         jump.open(AudioSystem.getAudioInputStream(getClass().getResource(myRoot + "./sounds/jump.wav")));

The exception is thrown at the third line.
The second line is just for testing and it doesnt throw an exception.

Thx 4 help

Moep
9  Game Development / Newbie & Debugging Questions / Re: Jump on: 2011-06-13 14:16:57
I am planning on implementing this later on but at the moment i like to have one single jump.
10  Game Development / Newbie & Debugging Questions / Re: Jump on: 2011-06-12 22:56:46
The posted code is in my "PhysicsThread" where i do all the calculations for movements and so on.
player.setGround(false) just sets the variable when i jump to false, basically i dont need it because in the collisionTest it sets the variable to false when i dont collide, but i like to make sure its false, so i cant jump midair.
11  Game Development / Newbie & Debugging Questions / Playing music in java on: 2011-06-12 21:10:58
Hey guys,
im currently playing music like this:

1  
2  
3  
4  
5  
6  
7  
//try
File fland = new File(game.getRoot()+"./sounds/land.wav");
Uri uri = fland.toURI();
AudioClip land = Applet.newAudioClip(uri.toURL());
//catch

land.play();


but when many audioclips come after another the game lags and the sound gets messy.

is it the right way to do it with audioclips or is there a better method?

Moep

12  Game Development / Newbie & Debugging Questions / Re: Jump on: 2011-06-12 20:46:50
I did it basically like ra4king and eli delventhal said.

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  
         if (player.isSpace())
         {
            if (player.getJumpTime() > player.getMAX_JUMPTIME())
            {
               player.setJumping(false);
            }
            if (player.isGround())
            {
               lastNanoTime = System.nanoTime();
               music.jump();

               player.setYvel(DYVEL);

               player.setJumping(true);
               player.setGround(false);
            }
            if (player.isJumping() && player.getJumpTime() <= player.getMAX_JUMPTIME())
            {
               player.setYvel(DYVEL);
            }
            if (player.isJumping())
            {
               nanoTimeDiff = System.nanoTime() - lastNanoTime;
               player.setJumpTime(nanoTimeDiff);
            }
         }


pls correct me if something is unnecessary or wrong!
its working for me.

thx 4 ur help guys.

Moep
13  Game Development / Newbie & Debugging Questions / Re: Jump on: 2011-06-10 00:20:12
I have yVel and Gravity.
So i will try out what you said namrog.

Ill post how it worked out when ive implemented it.
14  Game Development / Newbie & Debugging Questions / Jump on: 2011-06-09 16:55:19
Hey guys,
i want to improve the movements in my jump n run.
At the moment my jumps have always the same height no matter how long i press space.

How can i make it, so the jumpheight is depending on the time in which space is pressed.

I have some ideas, but they are complicated and i think there has to be an easier way.

Moep
15  Game Development / Newbie & Debugging Questions / Re: Level Editor on: 2011-06-03 15:20:59
Ok thank you^^
Im sry this is my first game and im programming it since about 2 weeks so im not that experienced yet =)
16  Game Development / Newbie & Debugging Questions / Re: Level Editor on: 2011-06-03 15:06:26
ah ok that sounds nice.
I will try serialization and that block thingy tomorrow or the day after tomorrow and give feedback then.
You can post an example of saving/loading if you want to, but as i said i cant test the next 2 days.

Thanks for your help =)

Greetings moep.
17  Game Development / Newbie & Debugging Questions / Re: Level Editor on: 2011-06-03 14:48:51
OK thank you i will look into that tomorrow.

Another question:
how can you "blockify" ur world?
I mean games like minecraft or terraria have everything seperated into blocks.
I think handling everything in blocks is making some stuff easier.
How can i achieve that?

Greetings moep.
18  Game Development / Newbie & Debugging Questions / Level Editor on: 2011-06-03 12:59:42
Hey Guys,
i am currently trying to implement a level editor into my little 2d sidescrolling jump n run.
I got it working since yesterday, but i dont know how i should save the levels.
What the level editor is doing:
i draw rectangles with my mouse ingame and those ectangles are getting saved in an rectangle-arraylist.
How can i save that Rectangle arraylist in an txt document or something so i can reload my levels?

thx 4 ur help
moep
19  Game Development / Newbie & Debugging Questions / Re: Collision on: 2011-05-29 20:47:47
Ok thank you i will try that tomorrow.
20  Game Development / Newbie & Debugging Questions / Collision on: 2011-05-29 16:59:47
Hey Community,

i have a question about Collision.
How can you determine what sides of a Rectangle intersect with the other Rectangle.
Or is there another way to determine if you get killed or kill the enemy (e.g. Mario).

Cant find it anywhere.

Thx for helping.
Moep
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.

xsi3rr4x (62 views)
2014-04-15 18:08:23

BurntPizza (60 views)
2014-04-15 03:46:01

UprightPath (73 views)
2014-04-14 17:39:50

UprightPath (56 views)
2014-04-14 17:35:47

Porlus (73 views)
2014-04-14 15:48:38

tom_mai78101 (99 views)
2014-04-10 04:04:31

BurntPizza (159 views)
2014-04-08 23:06:04

tom_mai78101 (254 views)
2014-04-05 13:34:39

trollwarrior1 (208 views)
2014-04-04 12:06:45

CJLetsGame (215 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
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!