Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (534)
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  
  TarCraft  (Read 3316 times)
0 Members and 1 Guest are viewing this topic.
Offline Damocles
« Posted 2011-11-22 21:50:30 »

TarCraft



http://damocles11.byethost9.com/tarcraft.html

Repell the attackers on the spacestation.
You have to rescue your comrades first.

-----

Second try, I was reworking this version a bit. There is still some optimization to do of course.

Offline moogie

JGO Knight


Medals: 12
Projects: 6
Exp: 10 years


Java games rock!


« Reply #1 - Posted 2011-11-22 22:00:49 »

whilst i luv the graphics, they are just a little static for my liking... perhaps you can scavange some bytes from back ground sprites to allow some marine animation?
Offline Damocles
« Reply #2 - Posted 2011-11-22 22:03:12 »

Its voxelgraphics actually.
But true, it looks too static.
Maybe I try some animated voxels.
But its kind of hitting the limit (for me) here.

Also the text has to go. Such a spacewaster.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline pitbuller
« Reply #3 - Posted 2011-11-23 00:09:22 »

Selection do not work if you go from downt to upwards.
Offline moogie

JGO Knight


Medals: 12
Projects: 6
Exp: 10 years


Java games rock!


« Reply #4 - Posted 2011-11-23 03:34:51 »

if you like another pair of eyes to run over your code to look for possible optimisations then i am happy to have a look. PM me if you like.
Offline ReBirth
« Reply #5 - Posted 2011-11-24 00:09:37 »

Nice remake!

however, I'm worry about the copyright thing. Is it okay to use same sprite as them?

if not, then it'll nice to see zergg as the enemy Grin

Offline Localhorst

Senior Newbie





« Reply #6 - Posted 2011-12-06 15:43:13 »

Hi, i have a question with understanding your sourcecode (http://damocles11.byethost9.com/applet/CraftCraft.java).

Somehow i have no idea how the passage between:
switch (unit [ i ][14])

and

g = imgScreen.getGraphics();

is working. Especially the "while (true)" loops do not seem to make any sense.

Regards
Offline delt0r

JGO Knight


Medals: 26
Exp: 18 years


Computers can do that?


« Reply #7 - Posted 2011-12-06 16:07:29 »

Locks up my browser every time. FF 4.0 linux 64bit.

I have no special talents. I am only passionately curious.--Albert Einstein
Offline Damocles
« Reply #8 - Posted 2011-12-06 22:09:35 »

The game runs fine on my Ubuntu.
Do you run an OpenJDK? I installed the original Java back, as I think OpenJDK ist still too flawed, and I dont see any
advantage for the normal consumer in it.

---

The code is the RTS-AI logic part.

The game is a bit old though, I will probably not submit it.
Was an early test on 4k.

Offline delt0r

JGO Knight


Medals: 26
Exp: 18 years


Computers can do that?


« Reply #9 - Posted 2011-12-06 23:12:51 »

latest java 1.7 here. Applets sux plain and simple...

I have no special talents. I am only passionately curious.--Albert Einstein
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Damocles
« Reply #10 - Posted 2011-12-06 23:31:05 »

You had posted about several problems with several other Javaprojects before.
How about updating your Firefox and reverting to Java1.6?

What else than applets to use for running a Javagame in a Browser then?

Offline delt0r

JGO Knight


Medals: 26
Exp: 18 years


Computers can do that?


« Reply #11 - Posted 2011-12-07 00:03:33 »

Yep thats  right. It is my fault and i need to spend hours fixing things... don't try that with paying customers.... FF 4.0 is not old. I also tried java 1.6 and openjdk FWIW. Every 4k comp, the "does not work here" are ignored. Its does nothing for the comp.

You know perhaps there really is a problem at the 4k end? After all, other applets work fine for me. Its 4k in particular that doesn't. 

I have no special talents. I am only passionately curious.--Albert Einstein
Offline Localhorst

Senior Newbie





« Reply #12 - Posted 2011-12-07 10:04:04 »

Yes i understood that these lines are for moving/attacking units responsible. To be honest i avoid using labels like hell so i have always problems with break and goto labels in general. Anyway especially these lines are confusing because i don't see how this should 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  
while (true) <---?
 if ((other != i) && (unit[other][2] == 0) && (unit[other][14] != 5) && (Math.abs(unit[i][0] - unit[other][0]) < 2) && (Math.abs(unit[i][1] - unit[other][1]) < 2))
              {
                unit[i][14] = 0;
              }
              else
              {
                other++; if (other < unitCount)
                {
                  continue;
                }

                break;

                int other = 0;
                while (true)
                {
...
 other++; if (other < unitCount)
                  {
                    continue;
                  }

                  break label4639; <---?
 
                  unit[i][15] -= 1;
...
 unit[i][14] = 0;

                      break; <---?
..


How is the code working if there is a break inside?
Offline ReBirth
« Reply #13 - Posted 2011-12-08 03:11:12 »

In my approach break and continue are worth use, goto not. Break and continue only affect flow of looping.

@OP: but you should submit this Smiley

Offline sproingie

JGO Kernel


Medals: 201



« Reply #14 - Posted 2011-12-08 07:30:57 »

Whether goto's worth using or not, I think you'll have a hard time using it in java.   But in general if you're shaving opcodes to fit into 4k, don't expect the most readable source code.
Offline Damocles
« Reply #15 - Posted 2011-12-08 14:57:51 »

In this case her the label was the easiest option to leave the whole while-loop.
If it works, why not use it?

Offline StephR

Senior Member


Medals: 9



« Reply #16 - Posted 2011-12-11 09:45:39 »

In my opinion, your TarCraft is the best looking game down here. These animated voxels are definitely something to deepen, considering your game and Star Vox 16K which uses them too.
Offline roland
« Reply #17 - Posted 2011-12-11 10:18:43 »

why cant you select by dragging from the bottom to the top?
Just get the smallest x,y and the biggest x,y in the rectangle and check if a unit is in there
Offline steveyO
« Reply #18 - Posted 2011-12-13 22:00:56 »

Screenshot looks good but doesn't work here am afraid. Firefox 3, Java6, Win2000

Start new Level:1
Exception in thread "Thread-9" java.lang.OutOfMemoryError: Java heap space
   at java.awt.image.DataBufferInt.<init>(Unknown Source)
   at java.awt.image.Raster.createPackedRaster(Unknown Source)
   at java.awt.image.DirectColorModel.createCompatibleWritableRaster(Unknown Source)
   at java.awt.image.BufferedImage.<init>(Unknown Source)
   at T.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)

https://play.google.com/store/apps/details?id=com.bullsquared.alggame Annoying Little Gits (Android)
www.bullsquared.com   Play java (applet) games! www.chessclockpro.com Free Online Chess Clock
Online ra4king

JGO Kernel


Medals: 336
Projects: 2
Exp: 5 years


I'm the King!


« Reply #19 - Posted 2011-12-18 03:09:28 »

Win2000?!?!? O________O

Offline ReBirth
« Reply #20 - Posted 2011-12-18 03:35:04 »

Firefox 3?!?!?! O_______O oh wait my desktop has that too.

Offline steveyO
« Reply #21 - Posted 2011-12-19 12:55:32 »

Yep pretty old config, but every other 4k game have played the past few years has worked on my still reliable Dell laptop!

https://play.google.com/store/apps/details?id=com.bullsquared.alggame Annoying Little Gits (Android)
www.bullsquared.com   Play java (applet) games! www.chessclockpro.com Free Online Chess Clock
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.

pw (35 views)
2014-07-24 01:59:36

Riven (33 views)
2014-07-23 21:16:32

Riven (21 views)
2014-07-23 21:07:15

Riven (24 views)
2014-07-23 20:56:16

ctomni231 (55 views)
2014-07-18 06:55:21

Zero Volt (47 views)
2014-07-17 23:47:54

danieldean (38 views)
2014-07-17 23:41:23

MustardPeter (43 views)
2014-07-16 23:30:00

Cero (59 views)
2014-07-16 00:42:17

Riven (56 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!