Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (754)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (842)
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
1  Games Center / WIP games, tools & toy projects / An Adventure Game - WIP (Open Source - On GitHub) on: 2016-02-16 13:27:18
This post is just to share that I've put the source this project:

for free use on GitHub:

If anyone's interested in my bad code ;-).

At least it demonstrates how to do:
* A basic Java game engine
* Input Handling
* AI / Pathfinding
* Multiplayer / networking

Note, there's still lots and lots of bugs and I'm definitely not a pro in this.

I might be planning to re-write this engine for a Mars Survival game inspired by "The Martian" by Andy Weir.

Cheers :-).
2  Games Center / Showcase / Re: My Little Dungeon - LD23 Game on: 2012-05-01 10:05:25
I played the game through, very nice when you realize that you can get "stuck" if you plan your route wrong and end up in a "rocky dead end" :-)

Some observations/thoughts:
1. if you go down a stair directly on top of a "slimey" then sometimes you cannot hit it and slimey can hit you ==> death.
2. Maybe some balancing: Skeletons should be a bit harder and you should maybe not get food when levelling up. Else it's actully quite simple to just make 20G rooms all the way down (alsmost) because you get food and health when levelling up and that rules out the "resting room" which I think is a SUPER idea :-) by the way.

3  Games Center / Showcase / Re: My Little Dungeon - LD23 Game on: 2012-04-30 21:38:50
This is a really nice game, very fun and addictive.... good job!!! :-)
4  Java Game APIs & Engines / Java 2D / Re: 2D point and click adventure: my firsts steps on: 2012-04-21 17:28:54

in this post:

There's a good basic explanation of how to start out a game.

Also look at the rest of the posts in Articles and Tutorials:
5  Game Development / Newbie & Debugging Questions / Re: Buffered image? on: 2012-04-18 14:54:30
What kind of problem / error do you have? The line [5] should compile just fine, I think.
6  Game Development / Newbie & Debugging Questions / Re: Buffered image? on: 2012-04-17 10:01:27
I'm running my game from a JAR file. Here I'm loading images like this:

Image zombieImg ="/img/zombie.gif"));

I then have to place "zombie.gif" in the folder "img" at the root of the JAR file.

ps. I'm using the same book :-).
7  Game Development / Newbie & Debugging Questions / Re: 2D game development? on: 2012-04-17 09:47:49
I know this book is not of the newest kind, but it really helped me a lot getting into writing my own (simple) java engine:

EDIT : changed the URL to where you can actually get the book :-).
8  Game Development / Newbie & Debugging Questions / Re: Can I add an abstract class as a KeyListener? on: 2012-04-14 09:58:14
Sure. This is what my keyPressed method looks like.

public void keyPresssd(KeyEvent e)
         switch (e.getKeyCode())
               case KeyEvent.VK_ESCAPE:
                      keyboard[KEY_ESC] = true;
               case KeyEvent.VK_ENTER:
                      keyboard[KEY_ENTER] = true;

That's the basic idea. The KEY variables are my own constants.

By the way, what is dependency injection?

He he, yeah, I think I'm following the basic idea, but I need more information:

1. You are writing about a "lag". How do you measure it, and how does it show itself?
2. How often are you polling the boolean array, and how are you doing this (ex. a while-loop with a sleep??) ?

Cheers :-).
9  Game Development / Newbie & Debugging Questions / Re: Image color not recognized 2nd time. on: 2012-04-13 20:57:19
One advice here. Go to menu Window -> preferences and then search for "refresh" in the filter.

Then enable:

* Refresh during startup
* Automatic refresh

These help a lot!
10  Game Development / Newbie & Debugging Questions / Re: Can I add an abstract class as a KeyListener? on: 2012-04-13 18:59:46
Ok so basically you guys think that this is a bad idea. Can you guys maybe give me some code samples as to what you are suggesting?

Well, I think you should try to make it work this way. IMHO it should. Then you can change it, and learn something in the process.

I'm still up for helping if you need it, but I need something more. Especially about the "lag", and how you are polling. Maybe a code sample or something? It's up to you :-).
11  Discussions / Miscellaneous Topics / Re: 0x10c on: 2012-04-13 11:46:33
It doesn't really matter. I'm quite sure that Notch implemented it in Java, but in the end all DCPUs will run serverside so we wouldn't know.

I know :-). It just sounded like @ReBirth thought that this was not implemented in Java.

Anyhow, it's an exciting game idea. I think all geeks at some point have dreamt of implementing some kind of detailed star ship simulation :-D.
12  Discussions / Miscellaneous Topics / Re: 0x10c on: 2012-04-13 11:34:29
If you follow him he already talked about it for long time. I always thought he was doing Java only.

But the DCPU-16 is implemented in Java right?
13  Game Development / Newbie & Debugging Questions / Re: Can I add an abstract class as a KeyListener? on: 2012-04-13 07:12:33
@evilfrenchguy I know that using a static object might not be the way to go, but still I think this should work.

I understand what you want to do, but not how you are doing it. Maybe you could post an example about how you are setting the array variable on keyPressed() and how you are polling the array?

Or you could send me the code (my email's in my profile) - I promise not to keep it :-).

@sproingie You're right that this might be the "ideal" way of doing OO, but I find sometimes there's a compromise between "Generic nice code" and "performing flexible code". I agree that "global" variables should be avoided because it's hell to debug, and it's nice to see on a methods definition which data it depends on.

I use a static Game object in my code though, where I keep states like DAY_CYCLE, so the AI and entities can lookup the time of day. Passing all that data around to every method would make a mess :-).
14  Discussions / Miscellaneous Topics / Re: 0x10c on: 2012-04-13 07:02:41
Yeah, we could even go and implement a JVM for that CPU :-P.

BTW, here's an attempt to make an emulator of the DCPU-16:
15  Game Development / Newbie & Debugging Questions / Re: Can I add an abstract class as a KeyListener? on: 2012-04-12 18:02:36
Hmm, I would think it would work fine since only one thing is setting the variables so no synchronization problems would occur.

Are you referring "lag" to the delay between key press / poll detection? becuase there will always be a lag when you're polling I guess.

I guess there are so many ways you could design this. I don't think I've ever done polling on key inputs or even polling at all. In cases where I seem to need polling I have used a Thread that does a Object.wait(); and then the code that sets the variable will do a Object.notify();

If you keep having problems with this, I'm sure we can figure something out, I just need to know more about what you are trying to do :-). And then, I'm not the big Java Guru myself :-D.
16  Game Development / Newbie & Debugging Questions / Re: Can I add an abstract class as a KeyListener? on: 2012-04-12 17:18:03
At least that's how I would go about it, if I needed to access something from different parts of the code (of course there are many ways depending on your design) :-).

Here's a full example of what I'm rambling about:

import java.awt.event.KeyAdapter;

public class MyKeyAdapter extends KeyAdapter
   private static MyKeyAdapter inst = null;
   private MyKeyAdapter()
   public static MyKeyAdapter getInst()
      if (MyKeyAdapter.inst == null)
         MyKeyAdapter.inst = new MyKeyAdapter();
      return MyKeyAdapter.inst;
   public static void main(String[] args)
      // then you access the key adapter like this

17  Game Development / Newbie & Debugging Questions / Re: Can I add an abstract class as a KeyListener? on: 2012-04-12 16:47:52
Hmmm, couldn't you just create it as either a singleton (a static variable in its own class) or a static variable elsewhere?

something like

class MyKeyListener extends KeyListener
  public static MyKeyListener instance = new MyKeyListener();

and then


I know that you should use a "getter" method for a correct singleton pattern, but this is just to show what I mean :-).

Why does it have to be abstract by the way?

18  Games Center / WIP games, tools & toy projects / Re: An Adventure Game - WIP on: 2012-04-12 16:04:02
Nice!! :-)))

@Nyhm - Thanks a lot for the feedback.

The "moving through a zombie" bug has been verified, will fix :-).
19  Games Center / Archived Projects / Re: Build & Defend -- A Tale of Survival on: 2012-04-12 08:13:08
This look REALLY nice :-).

Are you using some kind of framework? Or is this plain Java and home made engine?

Looking forward to the weekend then :-D.
20  Games Center / WIP games, tools & toy projects / Re: An Adventure Game - WIP on: 2012-04-12 06:35:30
@Nyhm - Of course you're right. Many games fails because we programmers do too much "gold plating" and focus on the last 5 % of the game, instead of focusing on the gameplay.

Your suggestion about smooth animation transistion between tiles is defninitely something I'm thinking about, and is a very good suggestion. At least it could be an intermediate steps towards smooth movement.

If anybody tests the multiplayer code - please tell me how it "felt" :-).
21  Games Center / WIP games, tools & toy projects / Re: An Adventure Game - WIP on: 2012-04-11 18:18:09
@Nyhm - Thanks for you comment :-)

I can tell you that the networking code is probably hopeless, and my code needs a lot of cleaning up.

If anybody's interested, I will probably post my source code here, in case anybody could teach my something. I am also very interested in network programming, and it seems like it's one of the most challenging areas in gamedev.

My next big step will be to move from discrete movement to fluent motion. But then I will have to optimize my networking, maybe move to UDP and introduce interpolation and prediction.... (swallows) .... ehm, seems like a lot of work :-D.

22  Games Center / WIP games, tools & toy projects / Re: WIP AppleBean - looking for general input on: 2012-04-11 17:46:11
Cool, worked nicely on windows 7 with Java 7.

I can see that you are also handling dynamic changes to the calculated path (for example if you set the two green guys on collision course, they actually avoid each other :-)).
23  Games Center / WIP games, tools & toy projects / Re: An Adventure Game on: 2012-04-11 17:00:56
Wheew! Finally I have something to show. I succeeded "somewhat" in implementing basic multiplayer capability in my game!! :-)

You can download the zip file from my site in the first post. Or the direct link below:
zip download (v0.3.0 - Latest multiplayer version):

Note, this is a multiplayer version, and cannot be played directly from your browser.
Short instructions are as follows:

1. download the ZIP (v0.3.0)
2. unzip it somewhere
3. run start_server.bat OR "java -cp adventure-030.jar adventure.server.AdventureServer"
4. run OR "java -jar adventure-030.jar player1 localhost 5555"

I think performance will suck on a WAN but on LAN it seems to work ok. Here's a quick high level listing of changes:

version 0.3.0 - 2012-04-11 18:21 CET

* Fixed - Map sizes != 50x50 were not working
* Fixed - All other keys now disabled in game
* Added - Implemented multiplayer capability!! (A hell of a lot of changes)
* Added - MasterZombies!!! Extra powerful zombie spawns every 2'nd night. (Only one can exist at a time)
* Added - Info console
* Changed - Map size now 100x100 tiles
24  Games Center / WIP games, tools & toy projects / Re: An Adventure Game on: 2012-01-01 19:31:11
Hi all, thx for commenting in this thread.

@Kevin, I'm honored by your comment! :-).

I've been busy with implementing multiplayer capability in this game, and so far it's going pretty well.

I made a small update though, to polish this state of the game a little bit. Heres the news:

* Fixed - keys sometimes not working.
* Fixed - threading synchronization problem in AStar service.
* Added - basic levelling system for main character.
* Changed - light calculation algorithm of tiles changed. Now using dynamic buffer.

Hope I will have some updates soon.
25  Games Center / WIP games, tools & toy projects / Re: An Adventure Game on: 2011-10-25 08:49:49
Gah! Ingen danska i mitt Java-forum! T_T
(No Danish in my Java forum!)

He he, sorry for my moment of weakness :-). Nice Swedish from google translate btw :-).
26  Games Center / WIP games, tools & toy projects / Re: An Adventure Game on: 2011-10-25 07:08:19
I do dig the domain ending in .dk  Cheesy
Nice game, ran fine.

He he, tak skal du have, ja, det er rart at støde på andre danskere en gang imellem :-).

Thanks for your feedback!
27  Games Center / WIP games, tools & toy projects / Re: An Adventure Game on: 2011-10-24 18:14:35
Ok so v0.2.3 is up (look at first post for link to game and changelog).

version 0.2.3 - 2011-10-24 19:43 CET

* disabled sound on linux and mac systems. Now working without sound.
* added threaded A* search algorithm to zombies. They can now do pathfinding!!!
* zombie reaction time balancing (made harder)
* changed color of health bar, now background more visible

Finally got the time to implement a proper A* algorithm for the Zombies. I have implemented it threaded, so it will spawn threads corresponding to your core/cpu count. I implemented it as a service, so Zombies "request" a calculation from a to b, and they will wait until result is available. It works pretty well but needs to be tweaked. Zombies needs to re-check if target is near pretty often and cancel their pathfinding.

Comments greatly appreciated!!

28  Games Center / WIP games, tools & toy projects / Re: An Adventure Game on: 2011-09-27 12:40:19
JAR ran fine. Just one little problem, I have 1380x768 monitor and it seems you game is too tall. Like the night effect.

Thanks a lot for your comment  Smiley

Yeah, this is just an early test (like everything else I've ever made, but I hope I'll make it this time  Tongue), so until I implement a resolution selector I will reduce the size to 1000 x 600. Good point.
29  Games Center / WIP games, tools & toy projects / Re: An Adventure Game on: 2011-09-26 17:19:53
Right now I'm messing around with the AI for the zombies. I'm implementing the A* algorithm for navigating, but only if they get stuck trying to get to their enemies.

It's working, but it's using way too many cycles. An example is that for a small path (4 moves) it's sometimes using 62ms, which is a lot. It might help to reduce logging, but still!

I'm splitting the calculations over several updates to compensate for this CPU usage, and I'm implementing a pathfinding queue, where zombies can register if they want to calculate.

I'll be back! :-P.
30  Games Center / WIP games, tools & toy projects / Re: An Adventure Game on: 2011-09-25 09:04:25
It must be your system then because that JAR runs fine on my computer.

Try completely uninstalling Java and reinstall.

I solved the problem. The problem was in the JNLP file. I required "all-permissions" becuase I just copied a standard JNLP file. No I changed it to "no-permissions" in "security" and I'm not signing the JAR anymore :-).

And v0.2.2 is up, just some balancing again + small fix:

version 0.2.2 - 2011-09-25 10:58 CET

* fixed zombies and gravestones allowed outside the map edges
* removed signing on jar
* balanced fighting a bit. Now zombies are harder to kill
* decreased the "speed" cost of moving again
Pages: [1] 2
DesertCoockie (36 views)
2018-05-13 18:23:11

nelsongames (81 views)
2018-04-24 18:15:36

nelsongames (73 views)
2018-04-24 18:14:32

ivj94 (755 views)
2018-03-24 14:47:39

ivj94 (85 views)
2018-03-24 14:46:31

ivj94 (626 views)
2018-03-24 14:43:53

Solater (101 views)
2018-03-17 05:04:08

nelsongames (182 views)
2018-03-05 17:56:34

Gornova (408 views)
2018-03-02 22:15:33

buddyBro (1068 views)
2018-02-28 16:59:18
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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‑
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!