Damocles
|
 |
«
Posted
2011-11-22 20:50:30 » |
|
TarCraft http://damocles11.byethost9.com/tarcraft.htmlRepell 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.
|
|
|
|
moogie
|
 |
«
Reply #1 - Posted
2011-11-22 21: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?
|
Java4k RIP 2014
|
|
|
Damocles
|
 |
«
Reply #2 - Posted
2011-11-22 21: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!
|
|
pitbuller
|
 |
«
Reply #3 - Posted
2011-11-22 23:09:22 » |
|
Selection do not work if you go from downt to upwards.
|
|
|
|
moogie
|
 |
«
Reply #4 - Posted
2011-11-23 02: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.
|
Java4k RIP 2014
|
|
|
ReBirth
|
 |
«
Reply #5 - Posted
2011-11-23 23: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 
|
|
|
|
Localhorst
Senior Newbie 
|
 |
«
Reply #6 - Posted
2011-12-06 14: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
|
|
|
|
delt0r
|
 |
«
Reply #7 - Posted
2011-12-06 15: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
|
|
|
Damocles
|
 |
«
Reply #8 - Posted
2011-12-06 21: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.
|
|
|
|
delt0r
|
 |
«
Reply #9 - Posted
2011-12-06 22: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!
|
|
Damocles
|
 |
«
Reply #10 - Posted
2011-12-06 22: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?
|
|
|
|
delt0r
|
 |
«
Reply #11 - Posted
2011-12-06 23: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
|
|
|
Localhorst
Senior Newbie 
|
 |
«
Reply #12 - Posted
2011-12-07 09: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?
|
|
|
|
ReBirth
|
 |
«
Reply #13 - Posted
2011-12-08 02: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 
|
|
|
|
sproingie
|
 |
«
Reply #14 - Posted
2011-12-08 06: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.
|
|
|
|
Damocles
|
 |
«
Reply #15 - Posted
2011-12-08 13: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?
|
|
|
|
StephR
|
 |
«
Reply #16 - Posted
2011-12-11 08: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.
|
|
|
|
roland
|
 |
«
Reply #17 - Posted
2011-12-11 09: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
|
|
|
|
steveyO
|
 |
«
Reply #18 - Posted
2011-12-13 21: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)
|
|
|
|
ra4king
|
 |
«
Reply #19 - Posted
2011-12-18 02:09:28 » |
|
Win2000?!?!? O________O
|
|
|
|
ReBirth
|
 |
«
Reply #20 - Posted
2011-12-18 02:35:04 » |
|
Firefox 3?!?!?! O_______O oh wait my desktop has that too.
|
|
|
|
steveyO
|
 |
«
Reply #21 - Posted
2011-12-19 11: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!
|
|
|
|
|