Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (115)
games submitted by our members
Games in WIP (563)
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 / Tiny Game 2010 / Re: [Journal] TinyStarfighter on: 2010-05-22 20:28:55
Alright, finally updated whats uploads.

No gameplay yet, but I'm slowly making my way to it. Here some concept art of what's to come:


Gonna make it more of a arcade shooter with upgradables instead of a EV Nova clone.. not enough space. Or more like, I don't want to put up with the lack of space. Maybe after I finish this game I'll try it..

Anyways, go visit the link in the first post and try out the new main menu and look at the in-game stats screen!
2  Games Center / Tiny Game 2010 / Re: [Journal] TinyStarfighter on: 2010-04-29 19:57:20
Watched Markus program on LiveStream and gave me a lot of ideas. For one I refactored my code to use packages and folders (for instance his EgaImage class is now in the notch.graphics package) I also added in his awesome image loading code so I can load normal PNG's and it automatically finds the closest colors! So I updated the live test in the first post with the new code. Most of it isn't visible, but I also fixed the scrolling stars. Before they cut off after a little bit, but now they go on forever!

I still am not completely sure WHAT I want to do with this. Do I just want to make it some arcade-type game with periodical weapon upgrades? Or do I want to make it something more like EV Nova with multiple systems, docking, trading, buying upgrades, etc...
3  Games Center / Tiny Game 2010 / Re: [Journal] TinyRoll on: 2010-04-28 14:03:08
Woah woah woah! Can you frame limit it? It must be going around 100fps it seems on my PC.
4  Games Center / Tiny Game 2010 / Re: TinyGame Resources on: 2010-04-24 22:50:35
How easy would it be to change that image loader for use with Markus' EgaImage class? I think the only major difference is that he uses a Byte array and you use a Int array for the pixels it seems.

I'll probably try to convert it soon either way I guess.
5  Games Center / Tiny Game 2010 / Re: [Journal] TinyStarfighter on: 2010-04-23 20:03:34
Currently revamping how the game is setup. I was using one big tinystarfighter.java file to handle both applet AND game stuff.. I've split the game-related stuff into Game.java that uses ALOT more functions and thus has more clearitiy than ever before. The idea was to get tinystarfighter.java as light weight as possible, and I think I'm succeeding. Cheesy After I am done with this refactorization, I'm going to get bullets working and shooting.

*Edit* Awesome! Everything is working on the first try... I guess this isn't a surprise because Eclipse keeps compiling the code as I go... this might've not be as fun as it was if it didn't show me errors as I went along..

*Edit2* Alright, got bullets nominally working! I had to wrangle me some bugs with the bullet Iterator and destroying bullets once they got to old. I found out that you had to remove it from the Iterator, NOT within my Update() method!

Try it out! I also made the music a little faster pace... http://galaxy613.110mb.com/java/
6  Game Development / Newbie & Debugging Questions / Re: Data Structures on: 2010-04-23 18:47:41
Thanks for all the replies to my post. I'm still trying to soak it in. It definitely gives me another option than the traditional inheriting hierarchy to think about. Smiley
7  Games Center / Tiny Game 2010 / Re: [Journal] Untitled Thought in Progress on: 2010-04-22 23:48:14
I personally don't have a problem with smooth scaling, as long as it's JUST smooth scaling and isn't hiding a larger resolution. Not sure how we'll verify that other than forcing people to show their rendering code or counting width and height of the pixels shown throughout play. So I understand you wanted to avoid this Shannon.

If a poll was setup I'll vote for possible up-scaling, but I don't really care either way.
8  Game Development / Newbie & Debugging Questions / Re: Data Structures on: 2010-04-22 03:34:22

I'll like to go back to this article for a second. It was a good read and I think I understand it, but what happens if one component needs data from another component? Will the component manager somehow know that some data needs to be sent to a particular component, if so... how? Say the Render component needs the variables of the Position component to do it's work, how will it get access to that data?
9  Games Center / Tiny Game 2010 / Re: TinyGame Resources on: 2010-04-20 21:41:37
Galaxy, any reason you're not using System.arraycopy in copyFrom?

No good reason, just that I didn't know System.arraycopy existed, I'm still a n00b you see. Tongue I searched for the Array class for such a function, but there wasn't one I could see so I gave up then and made my silly for loops.
10  Games Center / Tiny Game 2010 / Re: [Journal] TinyStarfighter on: 2010-04-20 19:10:37
Thanks Shannon! Now I can use the .jar like I wanted to. The only thing is I'm not using normal image files, I'm using Wyrframe's .ega image format. But it still looks like you can open InputStreams using those methods you just posted so it's all good and will probably help me in the future. Smiley

*Edit* The applet on my site is updated now, you should see the neat title screen now!

Also, Eclipse is pretty friggin nice. When I rename variables I just have to hover over the old variable name and click on "Rename" and it renames all the old instances. Cheesy

*Edit* Revamped the test page. It's now keeping track of how many hits it has and also looks a bit nicer.
11  Games Center / Tiny Game 2010 / Re: [Journal] TinyStarfighter on: 2010-04-20 18:14:57
Are you loading resources via the resource loader stream or by files? Files won't work.

Also, I can't get your applet to run. Just a white screen.

I'm loading the image as a file... is the a tutorial you could point me to on how to do it correctly? I'm not even sure what to Google search for to figure it out on my own. :X

The white screen is because of the current issue.. I'll upload a working version without the title screen soon.

*Edit* Ok I figured out a way to turn a URL into a InputStream and now I can load it using the URL to the image on my website, but it's not loading it from a local .jar which is what I wanted to do, but it IS working if you go to the link in the first post.
12  Games Center / Tiny Game 2010 / Re: [Journal] TinyStarfighter on: 2010-04-20 14:16:03
Thanks to Wyrframe's egaEditor, I have made a title screen for TSF when it's starts or paused!

The only problem is, the image is an outside file and when I try to upload it, it refuses to load it. So I tried putting all the .class's and the image inside a .jar file but that's not even working on my computer. Huh Jar's have NEVER been nice to me Undecided

Does anyone have any pointers? If all else fails I'll make the egaEditor save an array for pixels[] so I can just put it inside of my code...
13  Games Center / Tiny Game 2010 / Re: TinyGame Resources on: 2010-04-20 03:37:17
More functions for Markus' EgaImage class/framework:

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  
   // Copies the pixels of the supplied EgaImage
  public void copyFrom(EgaImage img){
      if (!(pixels.length == img.pixels.length))
         return;
      for (int x = 0; x < width; x++){
         for (int y = 0; y < height; y++){
            pixels[x + y*width] = img.pixels[x + y*width];
         }
      }      
   }
   
   // Flips the image
  public void flip(boolean horiz, boolean verti) {
      if (horiz) {
         int halfwidth = width;
         
         if (width % 2 == 1) {
            halfwidth--;
         }
         halfwidth /= 2;
         
         for (int x = 0; x < halfwidth; x++){
            for (int y = 0; y < height; y++){
               byte tmpColor = pixels[x + y*width];
               pixels[x + y*width] = pixels[(width - x -1) + y*width];
               pixels[(width - x -1) + y*width] = tmpColor;
            }
         }
      }
      if (verti) {
         int halfheight = height;
         
         if (height % 2 == 1) {
            halfheight--;
         }
         halfheight /= 2;
         
         for (int x = 0; x < width; x++){
            for (int y = 0; y < halfheight; y++){
               byte tmpColor = pixels[x + y*width];
               pixels[x + y*width] = pixels[x + (height - y -1)*width];
               pixels[x + (height - y -1)*width] = tmpColor;
            }
         }
      }
   }


flip() probably isn't completely optimized and what not, but it's supposed to be used while setting up an image..
14  Games Center / Tiny Game 2010 / Re: [Journal] Defendrex on: 2010-04-20 03:13:19
Thanks for sharing the source of the editor! I am glad you used Markus' framework so it's really easy for me to add some of my own code to it. Cheesy

Good luck on your game, I like the sound of the gameplay and I hope it pans out well. Smiley
15  Games Center / Tiny Game 2010 / Re: [Journal] TinyStarfighter on: 2010-04-19 18:00:42
Thanks. Hopefully I'll have more to show soon. I just got all 8 directions of the player's ship working and drawing. :3
16  Games Center / Tiny Game 2010 / Re: [Journal] Tiny Starfighter on: 2010-04-19 03:30:20
Thanks Demonpants. Smiley

Today I learned that threads are annoying. Angry Mainly a problem caused by trying to merge Markus' framework with Shannon's.

At anyrate, I now have all 8 directions of a space ship! Man I wish I had some webspace to show my latest stuff off on. :<
17  Games Center / Tiny Game 2010 / Re: TinyGame Resources on: 2010-04-18 03:17:07
Here's my TOTALLY AWESOME (not really :S) ToneSong class:

**EDIT: I totally forgot! you NEED bobjob's Tone.java file for this to work!!**

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  
// Bee Boop! Public Domain? Why not!

/* Use it like this:
 *       ToneSong bkground = new ToneSong (   new int[][]{
            {185, 1900, 50}, // Freq, MS, Volume 100..0
            {-1,-1,-1},
            {185, 1900, 50},
            {-1,-1,-1},
            {185, 1900, 50},
            {-1,-1,-1},
            {185, 900, 50},
            {164, 900, 50}
      }, 1000); // Each beat is 1000 Millisecs
      bkground.setLoop(true);
      bkground.play();
 * then just use bkground.update(); in the main loop!
 */


public class ToneSong {
   private int[][] song;
   private int note = 0; // Current note
  private int pace; // In milliseconds
  private long lastMS;
   private boolean playing = false;
   private boolean loop = false;
   
   public ToneSong (int[][] song, int pace) {
      this.song = song;
      this.pace = pace;
      note = 0;
      lastMS = System.currentTimeMillis();
   }
   
   public void play() {
      setPlaying(true);
   }
   
   public void update(){
      if (!playing)
         return;
     
      long curMilli = System.currentTimeMillis();
      if (lastMS+pace <= curMilli) {
         if ( song[note][0] > 0 &&
               (song[note][2] >= 0 && song[note][2] <= 100) ) {
            Tone.sound(song[note][0], song[note][1], (double)(song[note][2])*0.01);
         }
         lastMS = curMilli;
         note++;
         if (note >= song.length){
            if (loop)
               setPlaying(true);
            else
               setPlaying(false);
         }
      }
   }

   public void setPlaying(boolean playing) {
      this.playing = playing;
      this.note = 0;
   }

   public boolean isPlaying() {
      return playing;
   }

   public void setLoop(boolean loop) {
      this.loop = loop;
   }

   public boolean isLoop() {
      return loop;
   }
}


Great for making crap-tastic musics.
18  Games Center / Tiny Game 2010 / Re: TinyGame Resources on: 2010-04-17 15:33:45
Awesome Shannon, I'll update my applet right now to add all those nice features.

If anyone else is a super-n00b and want to get in on this keyboard-input action, here is my SimpleKeyboard.java file:

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  
// Honestly, this class borrowed heavily from a GameDev.net article.
// I couldn't think of a way to make it simpler without being too restrictive.

import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;

public class SimpleKeyboard implements KeyListener {
   private static final int KEY_COUNT = 256;
   private enum KeyState {
      RELEASED,
      PRESSED,
      ONCE
   }
   
   private boolean[] currentKeys = null;
   private KeyState[] keys = null;
   
   public SimpleKeyboard() {
      currentKeys = new boolean[ KEY_COUNT ];
      keys = new KeyState[KEY_COUNT];
     
      for (int i = 0; i < KEY_COUNT; i++)
         keys[i] = KeyState.RELEASED;
   }
   
   public synchronized void poll() { // Polls the system for input and updates based on received events.
     for (int i = 0; i < KEY_COUNT; i++) {
         if (currentKeys[i]) {
            if (keys[i] == KeyState.RELEASED)
               keys[i] = KeyState.ONCE;
            else
               keys[i] = KeyState.PRESSED;
         } else
            keys[i] = KeyState.RELEASED;
      }
   }
   
   public boolean keyDown( int keyCode ){
      return    keys[ keyCode ] == KeyState.ONCE ||
              keys[ keyCode ] == KeyState.PRESSED;
   }
   
   public boolean keyHit ( int keyCode ) {
      return   keys[keyCode] == KeyState.ONCE;
   }
   
   @Override
   public void keyPressed(KeyEvent e) {
      if ( e.getKeyCode() >= 0 && e.getKeyCode() < KEY_COUNT)
         currentKeys [e.getKeyCode()] = true;
   }

   @Override
   public void keyReleased(KeyEvent e) {
      if ( e.getKeyCode() >= 0 && e.getKeyCode() < KEY_COUNT)
         currentKeys [e.getKeyCode()] = false;
   }

   @Override
   public void keyTyped(KeyEvent e) {
      // TODO Auto-generated method stub

   }

}


You just need to make a SimpleKeyboard object and then use keyDown() and keyHit() methods while calling poll() during the main loop. The key codes are static ints of KeyEvent. (i.e. KeyEvent.VK_UP and so on)

I hope this helps some other guy starting out :3 The code is mostly copypasta from a GameDev.net with some of my own tweaks.

I've also been adding functions and making changes to Markus' EgaImage class, for instance I added:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
   public void fill(byte color){
      for (int x = 0; x < width; x++){
         for (int y = 0; y < height; y++){
            pixels[x + y*width] = color;
         }
      }
   }
   
   public void clear(){
      fill((byte)0);
   }


19  Games Center / Tiny Game 2010 / [Journal] TinyStarfighter on: 2010-04-17 05:45:37

Tiny Star Fighter

**Game Specs Subject to change!**
Fly around in full eight ( 8 ) directions of freedom!
Fight through five ( 5 ) sectors to stop an invading alien force!
Three ( 3 ) different types of weapons!
Two ( 2 ) nearly impossible ( ? ) to defeat bosses!

Try it! - http://galaxy613.110mb.com/java/ [Updated 5/22/10]

What I WANT it to be is a 8 direction space shooter. We'll see how far I get. Pictures below. The "lolcept" is just a concept, the other one is where I am at right now.
20  Games Center / Tiny Game 2010 / Re: 40x30 EGA Contest on: 2010-04-17 03:08:41
Man, if people continue posting engines in the TinyGame Resources thread, and other sources in this thread.... and if I get a crapton of luck.... I might be able to make a game or something! Shocked

I donno, I've always loved restraints, but this is a bit over the top, limited resolution AND limited color... I'm going to try some of those EGA tests in the other thread and see if I can get something working. Don't expect much yet. :S

*Edit* Yay! I got Notch's Ega test running with little problems. I'm inclined to work off of his framework because it's already applet-savvy.

*Edit2* Got a tentative name, "Tiny Star Fighter", or "TSF". Writing a real simple keyboard poller class.
21  Discussions / General Discussions / Re: Windows 7 on: 2009-11-10 21:12:54
I "upgraded" to Windows 7 64bit Professional from Windows XP 32bit. I've encountered no problems using Java on it either.

By "upgraded" I mean I did a custom install and did a clean install on a new partition instead of over writing my XP partition. I had no problems installing and activating my Windows 7 install, and generally, it's been pretty good. I also like the new taskbar... which I didn't see for long because I use SharpEnviro for my desktop shell.
22  Game Development / Newbie & Debugging Questions / Cannont find main class... Problems with making executble Jars on: 2009-11-07 20:41:34
I'm having troubles with getting my test program using Slick using Eclipse. I try to export the project as a "Executable Jar", but neither does it give me an error, or indeed do ANYTHING. I then try to Export as a normal Jar and specify which file the Main class is in, it says it doesn't exist. Here's a rar with two of the Jar's created by the above methods. ("solarance_test.jar" was made by the "Executable Jar" while "solarance_test6.jar" was made by the normal "Export Jar")

Every site I find that talks about making Jar's say it super easy, but apparently with how Eclipse works, it apparently makes it not easy at all. Can someone please point me in the right direction on how to continue?
23  Games Center / WIP games, tools & toy projects / Re: Space prototype thing on: 2009-10-26 03:22:27
Works here. (Win7, 64bit)

I really like. Smiley Get some basic trading, combat, and upgrading, and I dare say you'll have a fun little space game on your hands! I really like the looks of it so far so keep going!
24  Game Development / Newbie & Debugging Questions / Re: So I'm thinking of using Java... on: 2009-10-23 16:29:06
Thanks for everybody's response. Cheesy I'm feeling alot better about this pathway now, those links really helped Kapta, I've already got "SlickTest' running and I've already started playing around with it.

Thank JL235 for your input on Java v BMax, I think you confirmed what I was thinking. I've been talking to my friend and he's only reservation is that "I won't have to keep updating my runtime every damn day and doesn't run like crap." I think it won't be a problem but we'll see once I get further along how well it runs on his computers..

Thanks again for all the input! It's very appericated and I hope I can give back to the community in the months to come. Smiley
25  Game Development / Newbie & Debugging Questions / So I'm thinking of using Java... on: 2009-10-23 02:07:43
Ok, here is the down-low. I've been taking a Java class at my local community college and I've grown to like how it handles objects/classes, much cleaner than BlitzMax. Now one of the things that has always been a thorn in my side is I've never be able to find a good networking API for BlitzMax, but they seem to abound for Java. I mean the fact this site exists and I've already bookmarked a few pages means there is the support in place, but I have a nagging feeling I should stick with BlitzMax. I think my biggest concern is, is Java Game Programming worth my time? I really want to start programming mulitplayer games, but if it means spending 6 months of my time to learn that I just can't get it to work, then what is the point?

The game I want to make is a 2D Space Shooter with upwards of 50 solar systems that players can visit and battle each other/NPCs. So obviously it will have to have a complex server-side executable that controls all that, and controls sending data of only the current system each player is in to each player... I want the game to be twitch-based, meaning when the player presses the left arrow, his ship turns to the left, when he presses Up Arrow, his ship moves forward and so on. Would this be too much for a normal Java UDP protocol?

And to show, hopefully, I'm not full of crap here are some screenshots from my singleplayer Alpha made in BlitzMax along with a GUI concept for the next version.

http://i257.photobucket.com/albums/hh236/Galaxy613/s-pc-screenshot71.png
http://i257.photobucket.com/albums/hh236/Galaxy613/s-pc-screenshot72.png
http://i257.photobucket.com/albums/hh236/Galaxy613/s-pc-screenshot73.png
Concept - http://i257.photobucket.com/albums/hh236/Galaxy613/NewGUIcopy-3.png

What I am looking for is feedback on how possible this project would be and some friendly pointers to some tutorials or articles that deal with some of the issues in creating a game like this. It would be great to finally play with people inside my own game... online multiplayer is just something I haven't cracked yet.
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.

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

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

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

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

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

BurntPizza (31 views)
2014-09-19 03:14:18

Dwinin (48 views)
2014-09-12 09:08:26

Norakomi (74 views)
2014-09-10 13:57:51

TehJavaDev (102 views)
2014-09-10 06:39:09

Tekkerue (50 views)
2014-09-09 02:24:56
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!