Featured games (81)
games approved by the League of Dukes
Games in Showcase (495)
Games in Android Showcase (114)
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] 2 3 ... 12
1  Java Game APIs & Engines / Android / Re: Hello all on: 2014-09-17 18:54:33
Instead of starting with a solution and trying to work backwards, maybe try it the other way around: can you create an MCVE that demonstrates exactly what you're confused about?

Start from scratch, and if you really want to use code you found from the internet, then take it one small step at a time. Only add as much code as it takes to show us exactly what you're confused about. That way we can copy and paste your code into our own editors to see what's going on.

2  Java Game APIs & Engines / Android / Re: Hello all on: 2014-09-17 17:30:39
I'm not really sure what you're asking. Are you asking how to stop using a snake and to use something more like Pac-Man?
3  Discussions / General Discussions / Re: Microsoft to buy Mojang for $2 billion? on: 2014-09-17 14:33:59
Also, if you own a software, you are more likely to invest time into making is run (install an new JRE, fix drivers)
whereas a free game - that does not work instantly and painlessly - wont get the same effort. "Skip to the next"

There's even a name for this way of thinking. It's called the endowment effect:
4  Game Development / Performance Tuning / Re: Best way to go about many objects checking array for data? on: 2014-09-17 13:12:33
Like Cas hinted at, you're contradicting yourself a bit here: should every object impact every other object? Or should they only impact objects within a certain range?

If every object should impact every other object, then by definition you're pretty much stuck with looping through every object. Even that is an oversimplification. Recommended reading:

However, if each object should only impact neighbors within a certain range, then you could use a quadtree: (or some similar data structure that partitions your space)

You could also just use your 2D array as the partition: for each object, only consider other objects within a certain range of cells?
5  Discussions / General Discussions / Re: Microsoft to buy Mojang for $2 billion? on: 2014-09-15 21:31:20
He built up his reputation on giving the finger to big business, it's actually his fault people are reacting the way they are.
Not his fault, make your own mind up.

Exactly. To quote Notch again: "I’ve become a symbol. I don’t want to be a symbol."

It seems like a bunch of people have imposed some persona on Notch, and now they're angry that he doesn't fit into *their* ideas about how he should act. "He's selling out his core ethics" really means "some of my assumptions were wrong and that makes me mad".

I suppose this is an example of the fan entitlement that so many indie developers are (rightfully) complaining about lately. It's sad to see, but I guess this is a symptom of "indie" becoming a marketable thing.
6  Discussions / General Discussions / Re: Microsoft to buy Mojang for $2 billion? on: 2014-09-15 20:02:38
He built up his reputation on giving the finger to big business, it's actually his fault people are reacting the way they are.

As I said, I'm happy for the sale. But it still doesn't change the fact Notch sold out his core ethical foundation. There's really no way you can claim he didn't. Although I'm sure he hates the fact he is in such a spotlight people are pointing it out. Notch set himself up as a shining example of sticking it to the man, then sold out to the man. There's many other ways he could of left the Mojang/Minecraft world.

Regardless, I'm not upset by any of this. I used strong words to make a point, and the point really can't be argued.. people can just be annoyed that I was so blunt about it. Wink

I guess I don't really know the details, since I never knew Notch built up his reputation as being anti-business or something of that nature. In fact, the genius-level Minecraft merchandising had me believing that he, like the rest of us, had no problem monetizing his product. Maybe I don't know enough about Notch to be commenting.

But even taking everything you said as true (despite it all being subjective and mostly from Notch's perspective), I'm still not sure why this is bothering so many people. "Oh no some guy I don't know is making money off of the product that he made and I enjoy, how terrible...." The amount of whining this is generating should at least make it pretty obvious to everybody why Notch is leaving in the first place, haha.
7  Discussions / General Discussions / Re: Microsoft to buy Mojang for $2 billion? on: 2014-09-15 18:32:43
If he actually cared, he would of just given the company away to the other 2 owners and lived out his life just a comfortable with or without the 2.5 billion. Not ruin his entire reputation for more money he quite literally does not need.

To quote Notch: "It’s not about the money. It’s about my sanity."

I guess I don't understand people criticizing this move. He explained pretty well his reasons for selling *his* company, not that he owes anybody an explanation.

Why does this make you (and lots of other people) so angry, when it really doesn't impact you at all?
8  Discussions / General Discussions / Re: Microsoft to buy Mojang for $2 billion? on: 2014-09-15 18:00:18
Congrats/condolences to Notch and the rest of the team.

I've been a lurker here for years now, and although I never really "knew" Notch, I was around before he got super famous. I even remember the original Minecraft thread!

And it's been really surreal *for me* to watch Notch go from this regular dude posting his experimental games in the forum to this *force*. It's been surreal to watch this forum go from a bunch of old fogies talking about Java and game development, to a bunch of younger kids mostly inspired by Minecraft. There's nothing inherently wrong with younger people getting into programming, and in fact I would say it's mostly a *great* thing. But the change has been pretty stark, which is just sorta.. weird.

And that's coming from me, just a random non-famous lurker. So I can only begin to imagine how weird it must be for Notch himself.

Couple that with the stuff that Cas has been going through lately, and the Zoe Quinn drama, and I just sorta feel bad for these "famous" folks. The "typical" gamer is probably pretty obnoxious to deal with, and millions of them must be almost unbearable sometimes.

So I hope Notch can find a way back to his roots, just being a random dude on the forums posting his experiments. And the billion dollar nest egg probably won't hurt either. :p
9  Discussions / General Discussions / Re: Java 8 Default Methods and Multiple Inheritance on: 2014-09-15 16:04:40
An interface still can have no kind of member state, so using them as traits is not as straight forward as you might think.

Eh, you could specify getter functions in the interface and use them in place of state variables. I still don't think it's a great approach, but not because it's overly complicated.

This also makes me wonder what happens if two interfaces define the same default function...?
10  Discussions / General Discussions / Re: Java 8 Default Methods and Multiple Inheritance on: 2014-09-15 15:43:56
This seems a bit fishy to me, because it seems to violate the principle of favoring composition over inheritance.

Specifically, why can't Logic, Render, and Collision be *members* of your Ship class? What benefit do you get by inheriting from them instead?
11  Game Development / Newbie & Debugging Questions / Re: About the Java Runtime Environment on: 2014-09-11 18:38:40
See also:
12  Java Game APIs & Engines / Java 2D / Re: 2D Graphics texture. on: 2014-09-10 18:16:18
Here's the Java tutorial:

If that doesn't work, post an MCVE that shows what you've tried and where you're stuck, and we'll go from there.
13  Game Development / Game Mechanics / Re: Entity Component Manager on: 2014-09-10 13:21:51
I'm really not sure what you're asking. Maybe you'd be better off posting the Java code (as an MCVE) instead of the Ruby code?

If you're just asking how to add Class instances to a collection, then here is an MCVE of my own:

import java.util.ArrayList;
import java.util.List;

public class Test {

   public static void main(String... args) {
      List<Class<?>> classes = new ArrayList<Class<?>>();
14  Game Development / Newbie & Debugging Questions / Re: User Interface Animation : What to use? on: 2014-09-09 18:43:59
This completely depends on what you're using to code the whole shebang. Is this libGDX? LWJGL? JOGL? Swing? AWT? Something else entirely? Is this on Android or on desktop? What have you tried so far?
15  Discussions / General Discussions / Re: Bouncing a game idea around. on: 2014-09-09 14:50:04
Describing a game and asking some random people on the internet what they think is a bit fruitless, IMHO.

The important thing is: does this sound like a fun game *to you*? Does it sound fun *to program* this game?

Have fun with it, create a little playable demo, and then ask for feedback on the demo.

Ideas are cheap, and opinions on ideas are even cheaper. The hard part is sitting down and programming the darn thing.
16  Discussions / General Discussions / Re: Can a Single Developer Create a Big Game? on: 2014-09-09 14:45:48
Can a single developer create a large game? Absolutely.

That's not really your question though. Your question is: "Can *I* create a large game?" And we don't have the answer to that.

It takes a LONG TIME to acquire the skills necessary to handle a big project by yourself. It's not like Minecraft was Notch's first game. You said you've done a few small projects. How many is a few?

If *the process* of acquiring those skills sounds tedious or boring to you, then the answer is that you probably won't ever be able to take on a big project. But if the process itself sounds fun to you (learning new things, experimenting with stuff you've never used before, incrementally increasing the scope of your projects, etc), then there might be hope.

You won't acquire those skills by asking other people if it's possible, though. Get to work!
17  Game Development / Newbie & Debugging Questions / Re: Noob Questions From Nickropheliac: Adding ScreenShake Every Collision on: 2014-09-04 14:30:31
I agree with everything Drenius said.

Think about what you want to do: what exactly **is** screenshake? Can you describe it in very specific details that even the dumbest person on earth could understand? When you have that description written out, you'll have an algorithm that you can start thinking about implementing.

Continuously asking "how do I do this" type questions won't get you very far. You have to think about the problem, break it down into smaller steps, and then start working on one of those small steps. Create a little test program separate from your entire project that tries a few things out. Can you create a program that displays a single square that shakes? Can you make it so it only shakes when you press a button? When you have that working (separate from your Pong project), then you can think about implementing it into the larger solution.

And if you get confused on a specific step, then you can post an MCVE that shows us exactly what you've tried and where you're stuck, and you'll get much more help than if you keep asking "how do I do this" type questions.
18  Game Development / Newbie & Debugging Questions / Re: Noob Questions From Nickropheliac: Where to go to learn pong on: 2014-09-04 13:10:53
Looks like processing will be good to help my daughter to bridge the gap between scratch and java Cheesy

You might also want to check out's Hour of Code, which Processing participated in. Lots of resources at, especially in the Hour of Code, and especially in Processing's Hour of Code:

I'm slightly skeptical of the kind of tutorial you get these days which doesn't require the "student" to do anything more than read (optional) and then paste in the full working code. Is there any research showing how many people do anything more than skip to that step?

This is a valid concern. I am *very* against spoonfeeding full-code solutions to people. However, novice programmers do need to be shown the basics before they can do anything by themselves. I look at the tutorials as "the in-class lesson" where the teacher will walk students through the process of setting stuff up through an example. Then the "assignments" at the bottom are more like homework, or more generally, the stuff people want to do next is the homework. I assume OP's end goal isn't actually to create Pong, but to build upon that knowledge until he's making "real" games. Now that he knows how to create Pong, can he add some extra stuff to Pong? Can he create Arkanoid? Tetris? Mario?

In other words, although the tutorials do walk you through to the end process of creating Pong, that isn't where anybody actually wants to finish. My hope is that they'll be able to use that knowledge to create bigger and better games. And then when they have a problem, I can say "a-ha, looks like you didn't really read this part of the tutorial, better go back and read it more carefully".
19  Game Development / Newbie & Debugging Questions / Re: Noob Questions From Nickropheliac: Where to go to learn pong on: 2014-09-03 13:15:50
Warning: shameless self-promotion ahead!

I'm the admin of a site called Static Void Games, which, among other things, contains a bunch of tutorials that take you from "knowing nothing about programming" to "being able to make a simple game in Java".

The Pong tutorial is here:

But you should probably start with an even simpler tutorial, which you can get to from that same link. I actually recommend starting with Processing instead of Java, and the tutorials start out in Processing. But it's up to you.

I'd be happy to answer any questions you have about anything.

I should also note that we're in the middle of open-sourcing the whole site, so some things are still a little bit rough. In the tutorials, some of the images are missing, and some of the code is unformatted, but the basics are there.
20  Game Development / Newbie & Debugging Questions / Re: FPS Counter not calculating FPS correctly on: 2014-08-28 21:02:23
What I posted wasn't meant to be a fix, just a confirmation that your algorithm is working.

The total FPS is measured over the entire lifetime of the program. The FPS will be pretty low at the very beginning as everything gets started, but it increases to ~60 after a few seconds.

But since the FPS is measured over the whole lifetime, the average still includes that first second or so of low FPS, which is why the total average looks like it slowly rises and levels off.

The only point of what I posted was to confirm that you get around 60 FPS (or whatever FPS you specify), which is the only thing you should really care about.
21  Game Development / Newbie & Debugging Questions / Re: FPS Counter not calculating FPS correctly on: 2014-08-28 18:09:54
Your math seems fine. Here is something I put together:

public class Test{

   static long programStart = System.currentTimeMillis();
   static double totalFrames = 0;

   private static Thread gameThread;
   static double desiredFPS = 30;
   static double nanosToSleep = 1000000000L / desiredFPS;
   static double fps;
   static double frames;
   static long frameStartTime;

   public static void main(final String[] args) {

   protected static void startGameThread() {

      gameThread = new Thread() {
         public void run() {
            frameStartTime = System.nanoTime();
            while (true) {

               // Update

               // Render

               final long startTime = System.nanoTime();

               if ((System.nanoTime() - frameStartTime) / 1000000 >= 1000) {
                  fps = frames;
                  frames = 0;
                  System.out.println("FPS: " + fps);
                  frameStartTime = System.nanoTime();

               while (System.nanoTime() < startTime + nanosToSleep) {
                  try {
                  catch (final InterruptedException e) {

   protected static void render() { /* Blank */ }

   protected static void update() {

      double totalFPS = totalFrames/(System.currentTimeMillis()-programStart) * 1000;
      System.out.println("Total FPS: " + totalFPS);

This measures the total FPS over the lifetime of the program, and that matches up pretty closely to the goal FPS.

However, it looks like I was wrong in my initial answer of it being the placement of your frame logic, since I too am getting 59 FPS.

And that's because timing in Java (or in computers in general) isn't 100% accurate. Thread.sleep(1) does not actually sleep for 1 MS every time, and even the various timing functions are only accurate down to a few MS. This is dependent on the OS internal clock. From the API for System.nanoTime():

This method provides nanosecond precision, but not necessarily nanosecond resolution (that is, how frequently the value changes) - no guarantees are made except that the resolution is at least as good as that of currentTimeMillis().

All this means is that there's going to be some wiggle room in the different timing functions you're using. And that means that with a goal of 60 FPS, sometimes you'll get 59 FPS, sometimes you'll get 61 FPS, etc.
22  Game Development / Newbie & Debugging Questions / Re: FPS Counter not calculating FPS correctly on: 2014-08-28 17:40:31
Can you post an MCVE that we can play with? Right now you've left out quite a bit of your logic, which makes this pretty hard to debug.

Note that this shouldn't include any actual graphics or game logic, just enough to show us what you're doing.

For example, here is one I started trying to build for you, all you have to do is fill in your thread sleeping logic:

public class Test{

   public static void main(String[] args) throws InterruptedException {
      MyThread myThread = new MyThread();

   private static class MyThread extends Thread {
      long totalFrames = 0;
      public void update(){
      public void run() {
         //your logic here
23  Game Development / Newbie & Debugging Questions / Re: FPS Counter not calculating FPS correctly on: 2014-08-28 17:11:34
You start your frame count at zero instead of one. The other way to look at this is you don't increment your frame count for the last frame before printing it out.

Either way, the result is you only count from 0 to 59 instead of from 1 to 60.

You could just put your if statement below the increment.

But I really wouldn't worry about it. 59 vs 60 FPS is not something that anybody will notice.
24  Discussions / Miscellaneous Topics / Re: Killers/Murderers - Are they really wrong? on: 2014-08-27 13:44:42
Are we serious about this thread? Oh well, I'll bite.

Based off of the theory evolution, us and apes both have a common nature to dominate and use tools... isn't fighting for dominance the correct way to do things? Since we are animals (based off of the theory of evolution), and apes as well as many other animals fight to the death. Isn't murder, killing, fighting, part of who we are inside?

That's, uh, not exactly how evolution works.

People who don't understand evolution take the "survival of the fittest" part of natural selection and think it means "survival of the most cuthroat sumbitch of the group" and that's not true at all.

Because what you're looking for is the fittest at passing on their genes. This translates more naturally into "being a good parent" or "sticking with your mate throughout your child's life" or "cooperating with others" than it does murdering everybody in sight.

Think of "survival of the fittest" as happening between species instead of between individuals. Which group is more likely to survive: the group who has "evolved" to learn how to cooperate and work together, or the group that is constantly infighting?

This can be seen in other groups of animals, not just humans. Many animals hunt in packs or work together to protect their group. Lions, wolves, fish, ants, cats, birds, etc. This is why so many cultures have similar "morals": killing is wrong, children should be protected, etc. These are leftover from our evolution as a pack animal.

Sure, evolution also has some nasty side-effects. Going back to when we were pack animals split into separate tribes that fought for the same food and land, it was evolutionarily advantageous to have a general mistrust of people outside of your group. You protected people from inside your group, but *the others* were the enemy. This is where things like racism or general *otherism* come from.

Like other civilians, I dislike the view of killing and the loss of lives in others. Some may debate that society is there to make humans work together to reach a common goal, but it doesn't appear that we are so focused on that anymore. It's 2014, and our tools are getting strong, powerful, useful, and more dangerous. The thinking that once got us better lives are now making them worse in ways.

So, at our core we're pack animals that protect our own (because of evolution) but mistrust or even hate people from groups we view as *other* (because of evolution). Society (technology, communication, agreed upon rules, etc) has widened the group of people we can view as *from our group*- after all, I'm talking to you from hundreds or even thousands of miles away right now. That's a big change from not too long ago when the only contact outside your group was the other pack of humans across the river hunting the same deer as you.

Our biology has not quite caught up with our culture, so many of us have trouble with viewing people from "outside our group" the same as we view people from inside it. That leads to many of the big conflicts we have today. But hopefully, as our culture and technology improve (technology includes the internet, medicine, etc, not just bombs), we'll get better at including "others" in our own group and see them as people who should be cooperated with and protected, just like we view our own group.

Sure there are people who are mentally ill, or angry, but are they really bad? Is there a reason to this madness, possibly a rebellion to society? What are your thoughts on this topic?

Like I said, we got our sense of right and wrong through evolution: we view killing as wrong because evolution has made us into a more cooperative and symbiotic species. That's why many religions and cultures have such similar rules, because deep down, every pack animal has these kinds of rules, even if they don't have a language to explain it. Our "otherism" (our tendency to mistrust or hate people outside our group) is on the other side of that scale.

But morality and ethics are full of gray areas, so it's not as simple as "these people are bad". On the other hand, saying "there's no such thing as good or bad" isn't really true either, thanks to us evolving into a cooperative species.

Recommended reading list:'s_number
25  Java Game APIs & Engines / Android / Re: Hardware survey on: 2014-08-26 14:24:40
That's a good point, Cas. People talk about Android fragmentation like it's this big scary monster that nobody knows how to deal with, as if developers haven't been dealing with it since the first monitor was invented.

Actually I suppose people were dealing with this even before monitors: I wonder how many people complained about "printer fragmentation", haha.
26  Java Game APIs & Engines / Android / Re: Hardware survey on: 2014-08-26 14:13:14
This was an interesting read.

But I wonder how overstated the fracturing issue is, especially for game development. I remember seeing something from one of the big Java game developers (might have been princec or Mario Zechner?) saying that they never worry about it and just target the biggest device and scale down. That's what I've been doing for the few little Android games I've made.

I suppose it's a bigger deal for apps that have thousands of downloads or that have more sophisticated GUIs than a game, but for most people I wonder if worrying about this is a form of premature optimization?
27  Discussions / Miscellaneous Topics / Re: Do you ever actually just despise someone ? on: 2014-08-21 18:04:53
It's miscellaneous for a reason! We're a community, thus, sometimes silly community posts come up. Us, as a community, should be able to discuss basically anything we want for any reason regardless of it's association with java gaming. JGO doesn't just have to be strictly about Java, that's boring! How will we ever get to know each other more personally if we just have to stick "To business"? Why can't we just talk about other random things, is that not the entire point of this subforum?

I don't disagree with you. I guess this specific thread (who else hates people for no reason?) irked me a little bit.

Yes, we've had some silly topics in the past that made me cringe, but those really are far and few between. I don't see how this is any different than almost all the other stuff in this forum.

Maybe my cringe-reaction is a little more sensitive than yours. I just don't see the merit of a thread celebrating prejudice. I do see the merit in calling out prejudice for not being cool, hence my complaining about it.
28  Discussions / Miscellaneous Topics / Re: Do you ever actually just despise someone ? on: 2014-08-21 14:00:59
I fail to see how posts discussing the usefulness of other posts are useful.


They are useful because they can maybe help steer the direction of the types of posts in this forum: maybe next time OP wants to talk about being prejudiced, he'll remember that other people expressed a disinterest in this kind of post, and post about something interesting instead.

But for the sake of going down the rabbit hole: I fail to see how posts discussing the uselessness of posts discussing the usefulness of other posts are useful.

Chit chat monster, here we come.
29  Game Development / Newbie & Debugging Questions / Re: Private fields, not really private? on: 2014-08-20 18:45:05
Aint that a big security risk?

It seems like reflection is "to strong".

Anything that happens on the client side should be viewed as pretty much open to the client, including private variables, algorithms, passwords, etc.

What are you trying to do? What exactly are you afraid will happen?
30  Game Development / Newbie & Debugging Questions / Re: Private fields, not really private? on: 2014-08-20 18:13:38
Reflection comes with a pretty big "you can use this to break the rules" warning, so it's not really something you can -or should- worry about.

I mean, you can change the String that a String Object holds, and if you can do that, then pretty much all bets are off.
Pages: [1] 2 3 ... 12

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

The first screenshot will be displayed as a thumbnail.

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

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

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

Tekkerue (37 views)
2014-09-09 02:24:56

mitcheeb (57 views)
2014-09-08 06:06:29

BurntPizza (44 views)
2014-09-07 01:13:42

Longarmx (27 views)
2014-09-07 01:12:14

Longarmx (34 views)
2014-09-07 01:11:22

Longarmx (34 views)
2014-09-07 01:10:19

mitcheeb (40 views)
2014-09-04 23:08:59
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 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!