Java-Gaming.org Hi !
Featured games (87)
games approved by the League of Dukes
Games in Showcase (649)
Games in Android Showcase (181)
games submitted by our members
Games in WIP (700)
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] 2 3 ... 7
1  Discussions / General Discussions / Re: Simulating simple 2D mist on: 2016-01-29 20:01:06
Yep. I'm using overlaid clouds from paint.net and it looks pretty much like you're travelling through a cloud. I hadn't thought of parallax with clouds but I'll try that out.

The game is coming on nicely and it seems like it might be quite playable. The real issue is whether the screen is interesting enough. I guess there's a downside to setting your game inside a cloud! I'm using brightly coloured icons to symbolise different power ups and then floating everything in bubbles with the mist over laid on top. It's still very early days but I personally like shoot them up games combined with having to think quite hard on how to complete a level. Obviously each level then gets a bit harder each time.
2  Discussions / General Discussions / Re: Simulating simple 2D mist on: 2016-01-18 20:31:46
You could find an animated background with the mist already in it.
render background, entities and finally some mist particles/entities which move and change transparency.
Must admit I wasn't aware you could draw animated images. It might be a bit much though even with a low res game 800x600 but I'll see if I can find an animated mist gif.

I believe that picture shows the high altitude haze on Uranus. If you go to lower altitudes where the pressure is greater and it is a bit warmer, the haze would dissipate (it would be permanently overcast of course).
Haven't been but I think it wouldn't get any clearer lower down though as the gas would just turn to liquid as the pressure increases - probably like pea soup but colder. I think I'll stick with the popular image though rather than one with any scientific truth Smiley
3  Games Center / Showcase / Re: AutoInvaders - LD34 Compo Entry on: 2016-01-18 20:12:33
The graphics are very nice and the new screen effect is good.
To make the game more appealing you need to allow the ship to move where the player wants and get the aliens to move.
I also found the sound a little grating but I appreciate it's close to original arcade games (try out bfxr or similar).
4  Discussions / General Discussions / Simulating simple 2D mist on: 2016-01-18 17:03:11
I trying to write a 2D shooter game for each of the planets in the solar system. The next one is for Uranus - I'll probably call it Planet 7 to stop the snigering. The game itself is reasonably well thought out but my problem is how to portray the background scenery of the planet. The whole screen will just look grey which just looks a bit too dull. I thought swirling mists with the aliens flying through the mists might be acceptable but I'm a bit stuck on how to do this. Any thoughts?

I wondered about having a plain grey background and then drawing lots of irregular shaped grey shapes and changing their transparency on the fly while moving them about slowly on screen. Is there a better way?

Thanks for any thoughts
5  Discussions / General Discussions / Re: Releasing on Steam for a (very) indie developer on: 2016-01-04 22:05:29
Well I've signed up to steam and got their SDK. It's all in C++ which is interesting to look at but ... are there any interfaces for Java?

I'm thinking of going freemium and just allowing people to buy upgrades. I guess if people don't like the game then they won't of lost anything and the upgrades are just the upgrades you can earn by playing the game normally but it allows you to skip the easier stuff and fast forward into the more challenging stuff. I think that sounds fair. I'll try to use their leader boards (assuming I can get others to play it), the cloud save sounds straightforward and I already have some ideas for the achievements.

Regards the audience - are there demographics available?
6  Discussions / General Discussions / Re: Releasing on Steam for a (very) indie developer on: 2016-01-03 14:05:54
Oh well, thanks for being honest.

I do see plenty of small arcade style games in steam but I can't see any details on how well they actually sell. I might just bight the bullet and go for it anyway - it might be an interesting learning experience if nothing else. When it fails the green light then I guess you can tell me "I told you so"  Smiley

Mike
7  Discussions / General Discussions / Releasing on Steam for a (very) indie developer on: 2016-01-02 22:17:26
I like writing games (mostly arcade style shoot them ups) and I write them mostly for myself but I'd love to make a bit of money from doing so.
  • Is that a bad thing?
  • Am I being a bit unrealistic expecting money for this stuff?
  • Does anyone have any experience of putting Java games onto steam?
  • Do PC arcade games actually sell well (or at all)?
  • Is it easy to integrate a Java game into steam?
  • Is it straightforward to use their achievements, leader boards and cloud facilities?
  • If you have experience of releasing on steam - can I ask how you did? (a PM is fine and I promise not to repeat any info)
  • Is it mostly luck or is there a good formula to follow?

These are some of the games I have so far (Alien Swarm, Martian Assemblers and Seas of Neptune).
8  Games Center / WIP games, tools & toy projects / Re: Martian Assemblers - your opinions? on: 2015-12-21 20:29:09
That's a 45 min video! I will watch it at some point over Christmas but perhaps you could just mention briefly what design aspects you were concerned about or you thought needed adding. I'm quite hard skinned so don't worry about offending me Smiley I started off with the cartoon hills simply because they were easy to draw (I'm not an artist) but then found I quite liked the cartoon style and kept with it. I tried adding extra realism like moving shadows etc but they felt at odds with the "cartoon feel" so I took them out again. I'll admit my main interest in the game was the internal data structures to handle the varying assemblies that happen - from a coding perspective it's quite an interesting problem. I'd also never done a 2D side scroller before.

thanks for replying by the way.

[EDIT]I managed to get past the 1st 10 minutes of waffle and then that talk suddenly became much more enlightening. I'll look into some of the areas he mentioned.
9  Games Center / WIP games, tools & toy projects / Martian Assemblers - your opinions? on: 2015-12-21 13:42:15

I've been working on this for the past couple of months and just wanted some feedback. It's a basic shoot them up game and is intended for PC's and for MAME arcade cabinets. In this game the various Martians can assemble together to become a more powerful creature. Whatever characteristics they have will be inherited by the finished assembly. You can blow them apart but they'll just scramble back together into something different. There are various supply drops for weapon upgrades, health improvements or just points. There is a tutorial and various levels available. You can earn trophies at each level and you need to earn a trophy to start the next level. There are also global high scores (though the current entries are artificial).

Here's a quick video of the game which hopefully gives a rough idea of things:
<a href="http://www.youtube.com/v/NTT7NS9rwfE?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/NTT7NS9rwfE?version=3&amp;hl=en_US&amp;start=</a>

Any feedback welcome!
Mike
10  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-12-10 16:39:19
WHAT IF I CODE DIRECTLY IN BINARY, HAH! Roll Eyes
That's certainly how I started. You designed the program on wads of paper using assembly language, then you'd convert it all by hand to HEX working out jump addresses as you go, then you'd type it all in (this bit was a pain as any mistake was a disaster). When something ran it almost seemed like a miracle. Obviously you could only write programs that weren't too complicated (I think othello was the most I ever tried in machine code). My 2nd computer had an assembler built in and it almost felt too easy.

I don't think programming is any easier these days simply because we just try to do more than we did before. If you ever try coding micro controllers then this is very similar to the early days of home computers.
11  Discussions / General Discussions / Re: key events & capturing special keys on: 2015-12-10 12:30:40
Thanks for replying so soon. I am using VK_ALT but when I press that during a game, the game will wait until I press something else before accepting more input - not just firing input but movement etc. Actually it seems to wait for me to press the ALT key again before resuming play. The game doesn't freeze but it just doesn't accept any key presses until I press ALT again. Weirdly pressing escape will also bring it out of ALT mode. This seems to tie in with the ALT key expecting another key. I usually avoid code samples because others are a bit more picky about coding standards Wink

I don't usually use the ALT key on my keyboard so I have no idea what it's proper behaviour should be.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
   private boolean isFireButton( int key ) {
      if ( MameMode == 0 ) {
         // normal PC controls
         // weapons are switched using up/down keys
         return key == KeyEvent.VK_CONTROL || key == KeyEvent.VK_SPACE;
      } else {
         // arcade cabinet controls where CTRL, ALT and space are all separate weapon fire buttons
         if ( key == KeyEvent.VK_CONTROL ) {
            WeaponMode = 0;
            return true;
         } else if ( key == KeyEvent.VK_ALT && MaxWeaponMode > 1 ) {
            WeaponMode = 1;
            return true;
         } else if ( key == KeyEvent.VK_SPACE && MaxWeaponMode > 2 ) {
            WeaponMode = 2;
            return true;
         }
      }

      return false;
   }


12  Discussions / General Discussions / key events & capturing special keys on: 2015-12-10 10:15:25
To make my new game fully compatible with MAME (an arcade emulator) I need to support the user pressing ALT as the secondary fire button (CTRL and space are the other fire buttons). My code captures the key press using KeyEvent and fires the right weapon but it then sits around waiting for another key to be pressed because the ALT key was pressed. How do I make it treat the ALT key just like any other key press?

Many thanks

Mike

PS do you think a player can cope with having 3 different weapons? is it too many or is it more the better?
13  Games Center / Showcase / Re: Drift Area on: 2015-11-13 11:03:16
Works fine on Win 10. I started on a practice track with just my own car. The game is well polished with graphics that suit the game well. The physics seemed well done and I liked the way the barrier tyres move when you collided with them. Shame there isn't an audience which could do an animated cheer when you do something well.

Control of the car was reasonably straightforward but the level kept restarting for me. I assume I had done something wrong but it never told me why it restarted so I was left mystified. I also couldn't fathom the menu controls. I'd suggest you watch someone play the game without being told anything about it - then see where they run into problems. I personally found it very difficult to alter the track and add more cars. I also found some tracks just too slippery - the game should work out how capable the driver is and adjust to suit (I was pretty crap). I can't comment on the AI on the cars as I never saw any opponents.

I assume there are figure of 8 tracks later on in the game. You could also have "clown cars" that don't race but instead get in everyone's way. Maybe the audience members could run onto the track occasionally. Would you have repair pits on longer races, budgets, car options etc or is it pretty much the same on all screens.

I played for a couple of minutes but the menu controls simply frustrated me. I saw a "Buy" button and it looked that it might appeal to some but there wasn't quite enough in the game for me to press it.

Mike
14  Discussions / General Discussions / Re: Making Games for Nobody on: 2015-11-02 17:57:50
I get a great deal of satisfaction writing my own games (as a hobby), I even enjoy playing them but it does pee me off that I can't seem to make any money from them. I looked on Google play to see what they had and was surprised to see that most of the games were free (oddly I even found a game that had the same name as one of my games! I'm obviously going to have to try and come up with something more original). Part of me says I should hand them out free so more people can play the games but the other part of me reminds me how much time goes into writing these things.
15  Discussions / General Discussions / Re: Making Games for Nobody on: 2015-10-16 10:07:56
Top secret: it is luck.
Yep, that about sums it up, though I'm a roach that's not even in the bucket yet.
16  Discussions / General Discussions / Re: Making Games for Nobody on: 2015-10-16 08:34:24
There are ways! The intersection between "your ability", "a desire to make it", and "commercially viable" is small, but definitely present!

Cas Smiley
It sounds a bit like a Venn diagram - I suppose if the shaded part of the diagram happens to align with the ever changing desires of the public then there's a possibility of making money. I'd still call that luck though  Wink
17  Discussions / General Discussions / Re: Making Games for Nobody on: 2015-10-16 07:56:16
I wrote TinyChess because the challenge of writing a chess AI had been nagging me for 25 years.

I'm working on Vanguard because I am interested in creating arbitrarily complex AIs that will interact to form an even more complex social web.
I read your post and felt like I'd wrote it! I find it fascinating trying to program the AI in aliens - the idea of just making aliens more numerous and harder to kill is a bit of a cheat in my eyes. Also, if you get the chance, have a play with my little chess program.

Do you use any particular sound library?
Personally, I've recently started to use TinySound and find it easy to use and very efficient.

I was wondering what motivates you guys. Do you strive to create something for other people? For possible financial benefit? For intellectual satisfaction? How do you feel when you finish a project that polite friends and family members have a look at but you might be fully aware that people generally wont be interested?
I wish it were for financial benefit! I like to write old style arcade games to play in arcade cabinets - I get a great amount of personal satisfaction creating something that looks exactly like what I was after. This is balanced almost perfectly by the complete lack of interest by the general public. I have had people build arcade cabinets around my games and I found that quite a confidence builder though. I hoped that steam might allow me to release games (and sell them) to the public but I haven't quite got to that yet. Hey ho.
18  Discussions / General Discussions / A few TinySound questions... on: 2015-10-16 07:36:15
I'm using TinySound and I'm quite impressed with it. I just play sounds rather than music in my games. At the moment I have a Volume variable in my code and then apply it to the volume required for each sound to get the volume required ie
1  
MySound.play( GlobalVolume * volumeForSound )

Is there a better way? I read about a setVolume method but I can't find it, at least not with sounds.

If I change the GlobalVolume to 0 then I expected the game to be silent but it's just quieter - how do I turn off the sound?

I'm also trying to pan the sound between the left and right speakers by setting a pan value between -1 and 1 but I don't hear any real difference. Am I doing something wrong?
1  
MySound.play( volume, pan )


Is there a simple tutorial any where about this stuff? The code is very well written but I can't find any any documentation.
19  Games Center / WIP games, tools & toy projects / Re: Seas of Neptune on: 2015-10-06 19:56:15
Has anyone played it? I've nearly finished the damn thing now  Roll Eyes

It's just a standard arcade style shooter but your ship floats on jets above a simulated sea from which the aliens and gas bubbles come. The aim is to harvest rain and bubbles while fending off aliens and keeping your ammo, shields and fuel tanks from running empty. Pretty much everything tries to kill you but you can earn power ups to last longer. There's a tutorial to show you how to play (my 1st attempt at one of these). There's also a global high score list.

Any feedback would be welcome.

Mike
20  Game Development / Newbie & Debugging Questions / Re: Menu's , how not to brute force it? on: 2015-10-06 11:47:09
The way I'd do it (not being an OO type of guy) would be to have a simple set of parallel arrays. One would hold the name of the menu entry, another would hold it's current value, and another pair to hold min and max values. When it comes to altering these values I'd just display the menu entries along with the current value. The user would be allowed to move up and down (you'd need a variable to hold the pointer of where you are) and left and right would change the current value as long as it's not outside the min and max values. Every time you need to use one of these values in your program you'd just access the current value in the array. To make it more readable in the code you could have nice final values that point to the correct entry ie WAIT_TIME. This would only store int values but that's usually all you need. It's also very easy to add new items as you need them.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
final int MAX_SETTINGS = 20;
final int WAIT_TIME = 0;
final int DRAW_DISTANCE = 1;
...
String SettingsMenuName[] = new String[MAN_SETTINGS];
int SettingsCurrentValue = new int[MAN_SETTINGS];
int SettingsMin = new int[MAN_SETTINGS];
int SettingsMax = new int[MAN_SETTINGS];
...
int SettingPointer = 0;
...
sleep(  SettingsCurrentValue[WAIT_TIME] )
...


Mike
21  Game Development / Newbie & Debugging Questions / Re: trying to implement a daemon to write to web in my game ... failing on: 2015-10-06 08:06:15
Thanks guys. It's all working at the moment but I will improve the code going forwards. It's a bit of a shame you can't have an "asynchronous void" declaration on a method which would make life a bit easier.

1  
2  
3  
4  
5  
public class MyGame {
   ...
   private asynchronous void myDaemon() {
   }
}
22  Game Development / Newbie & Debugging Questions / Re: trying to implement a daemon to write to web in my game ... failing on: 2015-10-05 19:55:44
Might need a bit more source to deduce what you're trying to do here.
My problem was having a separate thread (that appears to be static) trying to access the variables in the main thread that aren't static. It then seems to throw the errors. I've managed to get it working by changing certain key variables to static.

How about showing/downloading the highscores only at the end of a game / in a special screen. There is really no need to download them every second.
The thread does nothing unless it needs to read or write scores to the web. It only writes a score if your current score is higher than the lowest score held for that game. I feel it should read the high scores periodically simply because other players may make it onto the table while the game is inactive. The intention is to put the game in arcade cabinets and this sort of feature is worthwhile. For testing the period is 5 mins but it will likely change to 30 mins or an hour in the future. It certainly doesn't read the scores every second.

Also, please don't use static if you don't know what it does. After you have made sure what it does, and you actually want something to be static, code it. If you make existing methods static, there is something wrong with the design for your code. If you haven't made any design (looks that way to me) I really recommend making one in UML. It is not only handy to gain insight in bigger projects, but it also makes clear what your code is doing. For starters, if you take those designs seriously, this means that you will write much better code that actually does something in a straight-forward manner. Well that's what I would recommend beginners anyway, professionals use this already...
Out of mild interest I clicked on your one project to see what type of "big projects" you work on. Quite frankly it amazed me that you feel you can talk down to other developers but thank you for your input anyway Wink
23  Game Development / Newbie & Debugging Questions / Re: trying to implement a daemon to write to web in my game ... failing on: 2015-10-05 13:30:52
I think I'm going to need more clues Smiley

Does it mean I can't use sleep in the run bit? is there something else I should use?
24  Game Development / Newbie & Debugging Questions / trying to implement a daemon to write to web in my game ... failing on: 2015-10-05 12:39:24
I have a game that works and I want to write any high scores to a central server so people can compare their scores. The idea is just to have a thread that loops once a second and either does nothing (most of the time) or reads the current high scores or writes the players high score. The program on the web works fine but I'm having issues getting my daemon code to compile with static non static errors:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
neptune.java:3951: error: cannot find symbol
                                try { this.sleep(2000); } catch (InterruptedException e) { ; }
                                          ^
  symbol: method sleep(int)
neptune.java:3962: error: non-static method writeHighScores() cannot be referenced from a static context
                                        neptune.writeHighScores( );
                                               ^
neptune.java:3966: error: non-static method isGameStillPlaying() cannot be referenced from a static context
                        } while( neptune.isGameStillPlaying() );
                                        ^
3 errors


My code is arranged like this:
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  
public class neptune extends Panel implements Runnable, KeyListener {
   int Score = 0;
        ...
   public static void main(String[] args) {
      neptune w = new neptune();
                ...
      try {
                   WebIO webIoThread = w.new WebIO();
      } catch (Exception e) { ; }
        }

        ...

   class WebIO implements Runnable{
      public void run( ){
         long timeLastAttempt = 0;

         do {
            try { this.sleep(2000); } catch (InterruptedException e) { ; }

            // if failed to load high scores then try again
            if (   neptune.ThreadAction == neptune.READ_SCORES
               ||   neptune.HighScoreScores[0] == 0
                  && System.currentTimeMillis() - timeLastAttempt > 300000L ) {

               timeLastAttempt = System.currentTimeMillis();
               neptune.readHighScores( 0 );
               neptune.ThreadAction = neptune.NO_ACTION;
            } else if ( neptune.ThreadAction == neptune.WRITE_SCORES ) {
               neptune.writeHighScores( );
               neptune.ThreadAction = neptune.READ_SCORES;
            }

         } while( neptune.isGameStillPlaying() );
      }
   }
}

My apologies if I've included too much/too little. The problem is, if I start to change variables to static, then this soon snowballs into more static/non-static errors. I assume I'm missing something simple and just wondered if anyone could have a quick peek.

Many thanks

Mike
25  Discussions / General Discussions / Re: Transitioning from Windows to Linux on: 2015-09-30 09:50:43
I use Ubuntu on my laptop (a converted C720 Chromebook with 64GB SSD) and find it very quick. I find Windows 10 OK (I preferred 7) on my desktop. If windows is slow on a brand new laptop then I suspect you need to get rid of the bloat ware. Look in the start-up folder for what's running and start deleting things you don't need. Have you virus scanned the laptop? Is the virus scanner running continually with too high a priority? If Ubuntu is running slow then it might be because it's running from a USB stick and needs tweaking to get better performance (here's one of many pages on this).

Installing applications like Chrome is usually simple as you just open the software centre, type the application you want and then click install.

For gaming windows wins hands down. I find it easier to develop small games on Linux as I'm familiar with all the tools I need but if I'm developing a large system at work then I go straight to Linux. The biggest win for Linux is that it's cheap, it's secure, it doesn't have bloatware and it tends to run fast on low end systems. I just chose Linux on my laptop because I wanted a cheap laptop (a Chromebook) that I could develop on installing Linux was relatively straightforward. Another option is to set up dual booting so you have a choice of Windows or Linux.
26  Discussions / General Discussions / Re: Threads, games and running on all CPU's on: 2015-09-27 19:49:03
This has all been very helpful to me. Things I've learnt so far have been:
  • Do not create anything in the draw routines ie (new Color, new int[10] etc).
  • Fewer calls to draw routines the better - a single fillPolygon is much better than multiple smaller polygons.
  • Get as much processing out the draw loops as possible - the single call above meant I could build the polygon array elsewhere.
  • The standard java sound is useless for gaming. I quite liked TinySound when I tried it.

The end result is my game now runs smoothly on my cheap chromebook (converted to Linux) using only 25% CPU which is better than I expected. The threads I now need for the game are just the main game thread and one to handle IO from the web for high scores etc. I currently don't need to speed the game up any more but I will look into using BufferedImages or VolatileImages. A few small questions remain though:

How do I change the volume or pan left to right with TinySound?

I currently call pain in my main run loop and record FPS as well as number of moves (of creatures/sea etc) per second (MPS). I limit the MPS to 30 to make the game playable but obviously with
my set up I also get 30 FPS as well. It's not an issue for me but I was curious how you limit the number of moves but allow the FPS to climb on faster machines?

So far there seems to be lots of ways of calling the program to get it to work. I need the nodraw option otherwise I'm met with a blank screen but others don't. If the user is on Linux then the java commands need to have a colons rather than semi colons in the path. Should I include a bat file (or many files) to run on Windows and a sh file to run on Linux?

I looked into JavaFX and some of it's features are neat but perhaps a little complex (30 lines to say hello world!!) but I'll try to persevere. It's big advantage to me though is being able to produce an executable so I'll continue to look into this.

I've uploaded the latest version to the web page now.

Mike

PS Has anybody actually played the game?
27  Discussions / General Discussions / Re: Threads, games and running on all CPU's on: 2015-09-25 09:49:57
I've change the sea stuff so only one call is made to draw the sea all at once. I think the biggest benefit of this is that the array can be built completely outside the draw code.

Thanks for pointing out the drawPolyline mistake - I could of stared all day at that and never seen it  Sad

I still can't get this damn library to work (it isn't the libraries fault, it's mine for just not grokking it).
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  
# 2 files in my directory
# neptune.jar
# tinysound-1.1.1.jar

# in the example code the developer does the following imports (assume I need them to?)
import kuusisto.tinysound.Music;
import kuusisto.tinysound.Sound;
import kuusisto.tinysound.TinySound;

# as well as the above I have the following in my main() method
TinySound.init();
Sound coin = TinySound.loadSound("doh.wav");
coin.play();
TinySound.shutdown();

# I tried the following to compile
javac -cp ./tinysound-1.1.1.jar neptune.java
jar -cfm neptune.jar Manifest.txt *.class *.png *.wav
java -cp ./tinysound-1.1.1.jar -jar -Dsun.java2d.noddraw=true neptune.jar

# got the following error when trying to run
E:\Dropbox\Projects\neptune>java -cp ./tinysound-1.1.1.jar -jar -Dsun.java2d.noddraw=true neptune.jar
Exception in thread "main" java.lang.NoClassDefFoundError: kuusisto/tinysound/TinySound
        at neptune.main(neptune.java:421)
Caused by: java.lang.ClassNotFoundException: kuusisto.tinysound.TinySound
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 1 more


Will try the image stuff after I get the sound working

Mike
28  Discussions / General Discussions / Re: Simple to use sound in Java games on: 2015-09-24 14:27:38
I haven't used external libraries in Java for anything. I figured I'd start with the TinySound option because it said it was easy to use and that always counts for a lot in my book.

I tried pulling the TinySound jar's but can't seem to work out how to actually set things up so I can use them. I understand about calling TinySound.init() etc. It's just working out how to include TinySound within my own program. Could someone explain (using really simple words) what I need to do. I'm on Win10 and just call javac from the command line.

Many thanks

Mike
29  Discussions / General Discussions / Re: Threads, games and running on all CPU's on: 2015-09-24 09:40:42
Also, why would you be using -Dsun.java2d.noddraw=true? No need for it. Just let Java figure it out.

... or just forget all this crap and use JavaFX.
With my last game I found that java didn't draw anything in full screen mode unless I had this option. The screen just changed it's resolution and then stayed black. I just tried running this game without the option and I'm staring at a black screen listening to the game play. I never understood why this happened  Sad

I understand it's better to use JavaFX but it's something new to learn and I can't even get TinySound to work at the moment Sad I'm aiming to write an arcade game for each planet in the system so maybe I'll try JavaFX for the next one Smiley
30  Discussions / General Discussions / Re: Threads, games and running on all CPU's on: 2015-09-24 08:52:04
This is a long post - sorry. I understand some of the points in the posts above and have implemented many - with varying success. The great news is that frame rates have gone from 20FPS to just over 30 which makes the game playable on the laptop but I still don't have sound. I'll try to summarise where I am:

Not creating things in paint makes sense and I've fixed the code.

Going from multiple large polygons to multiple smaller polygons with a large fillRect to paint the rest of the sea underneath the waves. I'm not sure why this should improve things but I've done it and it works fine. I've yet to try doing it all in just one call but I'll try this later. I should of kept records of frame rates etc so I could see what improved things and what doesn't.

I tried to call drawPolyLine but ran into a compiler error I didn't understand (it was late though):
1  
2  
3  
4  
5  
6  
neptune.java:1706: error: cannot find symbol
                og.drawPolyLine( WaterSurfaceX, WaterSurfaceY, w );
                  ^
  symbol:   method drawPolyLine(int[],int[],int)
  location: variable og of type Graphics
1 error


Sound is still an issue for me. I'm calling very basic stuff (as detailed here) and it's definitely not working on slower processors. I assume it's not threaded internally. I wanted to try TinySound but, in all honesty, I've never used any external libraries and I'm having a right pain trying to work out how I do it. I downloaded the zip. Unzipped it and placed it in a local directory under my main program dir called "kuusisto" - I wasn't sure what to call it or whether I should just have the plain jar in the same dir as my program. I tried setting the CLASSPATH with  set CLASSPATH=E:\Dropbox\Projects\neptune\kuusisto\tinysound-1.1.1.jar;%CLASSPATH% and get the following error:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
E:\Dropbox\Projects\neptune>javac neptune.java

E:\Dropbox\Projects\neptune>jar -cfm neptune.jar Manifest.txt *.class *.png *.wav

E:\Dropbox\Projects\neptune>java -jar -Dsun.java2d.noddraw=true neptune.jar
Exception in thread "main" java.lang.NoClassDefFoundError: kuusisto/tinysound/TinySound
        at neptune.main(neptune.java:387)
Caused by: java.lang.ClassNotFoundException: kuusisto.tinysound.TinySound
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 1 more

E:\Dropbox\Projects\neptune>echo %CLASSPATH%
E:\Dropbox\Projects\neptune\kuusisto\tinysound-1.1.1.jar;E:\Dropbox\Projects\neptune\tiny\tinysound-1.1.1.jar;%CLASSPATH%
So it compiled fine but blew up at run time in main() where I call    TinySound.init(); If I can get it to work will TinySound offer volume and panning?

I don't understand why bufferedImages are better or what a volatile Image is. I'm afraid there were too many acronyms and not enough simple words for me to make sense of things. I'm happy to try both but I'd prefer to know why I'm doing it. Is the idea to use BufferedImage's for the sprites and VolatileImage's for the sea and sky?

Thanks for the help so far and thanks for trying to understand this post (I did try to format it but this was the best I could do).

Mike
Pages: [1] 2 3 ... 7
 
KaiHH (167 views)
2016-01-31 23:15:29

sci4me (158 views)
2016-01-23 21:47:05

sci4me (142 views)
2016-01-23 21:46:58

KaiHH (177 views)
2016-01-19 13:26:42

theagentd (261 views)
2016-01-05 17:10:00

ClaasJG (278 views)
2016-01-03 16:58:36

chrisdalke (270 views)
2015-12-28 06:31:21

Guerra2442 (278 views)
2015-12-25 03:42:55

Guerra2442 (282 views)
2015-12-25 03:27:21

theagentd (302 views)
2015-12-21 14:43:24
List of Learning Resources
by SilverTiger
2016-02-05 09:39:47

List of Learning Resources
by SilverTiger
2016-02-05 09:38:38

List of Learning Resources
by SilverTiger
2016-02-05 09:35:50

Rendering resources
by Roquen
2015-11-13 14:37:59

Rendering resources
by Roquen
2015-11-13 14:36:58

Math: Resources
by Roquen
2015-10-22 07:46:10

Networking Resources
by Roquen
2015-10-16 07:12:30

Rendering resources
by Roquen
2015-10-15 07:40:48
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!