Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (523)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (592)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  [Journal] TinyStarfighter  (Read 6761 times)
0 Members and 1 Guest are viewing this topic.
Offline Galaxy613

Senior Newbie





« Posted 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.

Programming since 2001 (Technically Tongue )
Uses: BlitzMax, Java, C++
Computers: W7 Desktop and a Triple Booting Netbook.
Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 11
Exp: 10 years


Game Engineer


« Reply #1 - Posted 2010-04-17 18:14:42 »

Looks cool. Smiley

See my work:
OTC Software
Offline Galaxy613

Senior Newbie





« Reply #2 - Posted 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. :<

Programming since 2001 (Technically Tongue )
Uses: BlitzMax, Java, C++
Computers: W7 Desktop and a Triple Booting Netbook.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Markus_Persson

JGO Wizard


Medals: 16
Projects: 19


Mojang Specifications


« Reply #3 - Posted 2010-04-19 14:57:19 »

That's looking mighty good. =D

Play Minecraft!
Offline Galaxy613

Senior Newbie





« Reply #4 - Posted 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

Programming since 2001 (Technically Tongue )
Uses: BlitzMax, Java, C++
Computers: W7 Desktop and a Triple Booting Netbook.
Offline Galaxy613

Senior Newbie





« Reply #5 - Posted 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...

Programming since 2001 (Technically Tongue )
Uses: BlitzMax, Java, C++
Computers: W7 Desktop and a Triple Booting Netbook.
Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 11
Exp: 10 years


Game Engineer


« Reply #6 - Posted 2010-04-20 14:37:43 »

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.

See my work:
OTC Software
Offline ShannonSmith
« Reply #7 - Posted 2010-04-20 15:08:21 »

With the typical resource sizes for these games I think it makes a lot of sense to Base64 encode them into String literals embedded in code. I am writing my own paint program applet that will output a string that you can dump your code with some code for loading them. Should be done in a few days.
Offline Galaxy613

Senior Newbie





« Reply #8 - Posted 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.

Programming since 2001 (Technically Tongue )
Uses: BlitzMax, Java, C++
Computers: W7 Desktop and a Triple Booting Netbook.
Offline ShannonSmith
« Reply #9 - Posted 2010-04-20 18:58:55 »

For loading resource from a jar that is included in the classpath:

1  
2  
3  
4  
5  
6  
// The recommended way to get the classloader
ClassLoader cl = Thread.currentThread().getContextClassLoader();
// Get an input stream of the resource, assuming it is in the root directory of the jar, if it is in a subdirectory use "pathtoresource/myimage.png"
InputStream stream = cl.getResourceAsStream("myimage.png");
// Get a buffered Image using ImageIO system:
BufferedImage img = ImageIO.read(stream);


Alternatively use the applet to load the resource:
1  
2  
3  
4  
5  
6  
// Get the classloader
ClassLoader cl = Thread.currentThread().getContextClassLoader();
// Get the resource URL
URL url = cl.getResource("myimage.png");
// Use the applet getImage to load the resource
Image image = getImage(url);


Alternatively use the Swings ImageIcon loading routine to get the resource, this is (or was) probably the most robust/fastest method
1  
Image image = new ImageIcon("myimage.png").getImage();


All of these rely on the jar being included in the classpath and also using the correct path to the image.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Galaxy613

Senior Newbie





« Reply #10 - Posted 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.

Programming since 2001 (Technically Tongue )
Uses: BlitzMax, Java, C++
Computers: W7 Desktop and a Triple Booting Netbook.
Offline Galaxy613

Senior Newbie





« Reply #11 - Posted 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/

Programming since 2001 (Technically Tongue )
Uses: BlitzMax, Java, C++
Computers: W7 Desktop and a Triple Booting Netbook.
Offline Galaxy613

Senior Newbie





« Reply #12 - Posted 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...

Programming since 2001 (Technically Tongue )
Uses: BlitzMax, Java, C++
Computers: W7 Desktop and a Triple Booting Netbook.
Offline Galaxy613

Senior Newbie





« Reply #13 - Posted 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!

Programming since 2001 (Technically Tongue )
Uses: BlitzMax, Java, C++
Computers: W7 Desktop and a Triple Booting Netbook.
Offline me

Senior Devvie


Projects: 4


Java games rock!


« Reply #14 - Posted 2010-05-26 09:33:27 »

Hello Galaxy613,

Ran on:
                   Acer Aspire 5740, Windows 7 , Internet Explorer, jdk1.6.0_20
                   Mac Mini, Snow Leopard OS X, Safari, jdk 1.6.0_20
                   Suse 10 (Virtual Machine), firefox 2.0.0.14, jdk 1.6.0_19
                   HP Compaq 6820, Fedora 8, Firefox 2.0.0.10, jdk 1.6.0_04

For the Mac there was one time a situation that it crashed safari. Could not
reproduce it the second time. I think I was flying to the upper right corner and
pressed two keys simultaneously to get to the bottom right screen while I was
pressing the fire button.

I noticed that the stars are being drawn when for instance I move up. It always
takes a while before they are drawn. Maybe you are after that effect, I don't know,
but I just noticed it.


Good luck with the rest of the project.

Best regards from

M.E.

M.E.
--------
Offline Sardtok

Senior Newbie





« Reply #15 - Posted 2010-07-07 10:44:07 »

The physics of the movement is pretty nicely done.

I'm guessing there's some kind of mathematical miscalculation as to what stars are shown, but they seem to be drawn in the right place when they do get shown. *shrug* (The problem referred to by M.E.)
In the worst case scenario it seems the ship has to pass the star tile before it gets drawn, or when flying in the opposite direction it disappears when the ship flies past it. And it only seems to happen when flying far to the top left (both the top tiles and the left tiles disappear early), but I haven't tested it extensively.

When I've done space shooters, I just use some simple particles with positions relative to the viewport (local/relative, not global/absolute positions), it really simplifies the wrapping.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

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

The first screenshot will be displayed as a thumbnail.

SHC (24 views)
2014-11-25 12:00:59

SHC (22 views)
2014-11-25 11:53:45

Norakomi (19 views)
2014-11-25 11:26:43

Gibbo3771 (22 views)
2014-11-24 19:59:16

trollwarrior1 (36 views)
2014-11-22 12:13:56

xFryIx (74 views)
2014-11-13 12:34:49

digdugdiggy (52 views)
2014-11-12 21:11:50

digdugdiggy (46 views)
2014-11-12 21:10:15

digdugdiggy (41 views)
2014-11-12 21:09:33

kovacsa (68 views)
2014-11-07 19:57:14
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

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
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!