Hi !
Featured games (90)
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]
1  Discussions / Community & Volunteer Projects / Re: [Wanted] Developers, Pixel Artists and Bgfxr on: 2012-08-22 23:58:28
Is this going to be programmed in pure java? Or are you using OpenGL/LWGJL?


@OP the game gets me at around 60% CPU, dual core @2.53 gHz. Also, I liked the old jumping sound better.

I just got home; going to look into the performance issues now.

 | Nathan

What are you using for your game loop? Timer class? Thread.sleep()? Thread.yield()? sleep() and yield()? Are you using ticks or fixed FPS?

2  Game Development / Game Mechanics / Re: Why is there no circle class? What do you use? on: 2012-08-18 04:20:17
It's really easy to work with circles even if you don't have an existing collision detection library to work with. For example:

public boolean circleHitTest(double cx, double cy, double x, double y, double r)
  double dx = x - cx, dy = y - dy;
  return dx * dx + dy * dy < r * r;

public boolean twoCircleCollisionTest(double x1, double y1, double r1, double x2, double y2, double r2)
  double dx = x1 - x2, dy = y1 - y2, d = r1 + r2;
  return dx * dx + dy * dy < d * d;

You probably should avoid using geom classes for physics related things in games. Circle collisions are easy enough to implement that they can be incorporated into an existing class with hardly any code. If you already have a class that handles game objects you can store its data in private fields. Its position can be stored in public or private double x, y fields instead of a Point class; store its boundaries as private static final double leftOffset, rightOffset, topOffset, bottomOffset instead of in a Rectangle class (for AABB tests, circle collisions would only need to store private static final double radius); and collisions can be handled in an update() method. There are no absolute rules, but why write your game around the geom classes?

The two "best" options are probably to 1) implement your own collision tests inline with the rest of your code or as static methods in utility classes - if you have a final plan in mind and want that level of control or 2) use existing libraries - if you plan to create a more complicated game physics system that relies on multiple generic forms of collision detection (and most collision detection libraries are object oriented and polymorphic), then a library dedicated to that purpose is likely suitable and easier to use.

again, thanks for the great insight. I gotta admit that I followed the crowd on this one. I started out doing collision checking with my own code. Using simple mathematical formulas I had the program doing some calculations (sort of like what you have there in that piece of code) to do all the collision checking I needed. Then reading a few posts in some forums, and in some tutorials I noticed that all those people were using the geom package (more specifically the Rectangle class) for collision checking. And that didn't involve any processing of my mathematical filters/calculation of formulas for the program, and that intersects() method seemed to get the job done and possibly better. So i thought using geom was a better way to go at it. So what exactly is wrong with using geom? Does it actually require more processing then what I was doing prior to using it?

btw, thanks for that bit of code there, gonna implement them and see how they work.
3  Game Development / Game Mechanics / Re: Resource Loading manager. Onto memory or not? on: 2012-08-18 04:05:32
Great, thanks people:

@sproingie and kaffiene, thanks for the insight! I'll definitely will be looking more into the CacheBuilder and the Reference classes (I've mildly seen them in the API, but I'm definitely gonna take a better look at those you mentioned there).  Cheesy

@Best Username Ever, thats a lot of great tips, I'll have to re-read to fully absorb it all, but by any means, thanks for taking the time to write that and give me more to think about/look into/try out.  Wink
4  Game Development / Game Mechanics / Resource Loading manager. Onto memory or not? on: 2012-08-16 18:10:41
Since I don't mind reinventing the wheel for the sake of learning something I've been working on a small engine/framework as a foundation to work on some simple games. When I was working on my imageLoading manager (part of the resourceLoading bundle), at the moment I have it set up in a way that once a image is loaded, its temp. held (in memory) by the program as long as its running. If a call asks for an image that hasn't been loaded yet, it does so, else it returns the copy that was loaded and stored in a hashmap (which essentially is in memory).
I've also done pretty much the same for my audioResourceLoading manager.

Now what I'm thinking of implementing down the road is that the imageLoading manager only holds image files that are under a certain size or animations (other things like static backgrounds can be reloaded if needed).
And as for the audio, if its sound effects its pre-loaded onto a clip and therefore its held in memory. But for large audio files like background music, I'm thinking of maybe streaming it and buffering it so that its played as its loaded, with a sourceDataLine.

One thing I'm wondering is, I know when i load an image and an instance is presenting it on the screen (using it as representation), its being held in memory. Now if I'm putting a copy of it in a hashmap will that copy be in memory as well? or is it using the same memory space as the first one that was loaded? Same goes for when I create other instances that use this same image as a representation. Does anyone know?

And yes I know tools like Slick2D handle all this resource loading stuff for you (or so I've read), but I'm mostly doing it for the learning experience. For example to get that audioLoader going I learned a great deal of the sound API.

 So yeah, just wanna hear some thoughts on this.  Grin
5  Game Development / Game Mechanics / Re: Why is there no circle class? What do you use? on: 2012-08-16 17:22:43
well, when I made that circle class, I gave it much of what the rectangle class has such as contains() and intersects() but using GeneralPath to create a polygon that with just 20-24 vertices forms a circle. its got a intersects() for checking against rectangles and another one for checking against instances of the same circle class. I implemented the distance method that you mentioned for checking between those of the circle class. So I'm well aware of that method and how to use it.
But instead of checking that circle/entity against all others I simply created a circular range of view around the smaller circle. And sort of like a radar it checks if there is anything within range and then I have other methods that handle what to do on each situation.

And going with what philfrei said about how things would happen in real life. I'm looking more from a organism perspective in that we check before we move. So I'm thinking if an instance is constantly checking its path ahead of time before it moves its also an alternative.
6  Game Development / Game Mechanics / Re: Why is there no circle class? What do you use? on: 2012-08-16 03:55:44
well an ellipse is an ellipse because its got two foci points and therefore it doesn't have a radius. Whereas a circle only has one focus point and it does have radius where any distance from the focus point to any point in the circumference of the circle would be constant.
Now a square is a square because its width and height are equivalent.
You can't just say a rectangle is technically a square and an ellipse is technically a circle. They're all different else they wouldn't have different names and mathematical explanations of what they represent.

But other then that... what do you guys use for collisions besides rectangles? or do you use the Geom package at all?
7  Game Development / Game Mechanics / Re: Why is there no circle class? What do you use? on: 2012-08-16 00:42:48

Doesn't the ellipse class technically use an underlying Rectangle? it says so on the API. It's still not a perfect circle.


Also circles are so simple I generally wouldn't use the geom versions anyway. Same goes for rects.

So you don't use classes from the geom package for collisions? What do you use?
8  Game Development / Game Mechanics / Why is there no circle class? What do you use? on: 2012-08-16 00:11:49
you would think it being such a simple geometrical object, it would be within the java.awt.geom package along with Rectangle. And I've noticed a lot of people use it for collision checking. I find it that on certain occasions it might be preferable to use a circle for collision checking. So what do people use other than Rectangle? Since I needed to do collision checking with circles I kind of just went and made my own Circle class. But I'm curious as to what people use.  Pointing
9  Discussions / Community & Volunteer Projects / Re: [Wanted] Developers, Pixel Artists and Bgfxr on: 2012-08-05 15:55:32
well thats what i would need, but i still belive a coder is important Sad me and nathan are still beginners and we are not being able to fix some bugs, while the game looks cool from outside and somehow the code is organized, some things simply doesnt work as they should, so an experienced dev would really help ^^

This is a new version of the game, now u can place dirt tiles !

Not that I'm an experienced developer, but what exactly is it that you need help in? Finishing up the game, consulting, small help here and there tackling bugs, code structure...?
10  Games Center / WIP games, tools & toy projects / Re: [HARDLY WIP] WorldOfCube on: 2012-06-13 03:04:43
Uhmm... strange thing going on for you... I'm sorry, but that is kind of hard to do Error-checking there, because it's not inter-process.

Soon I will release a big release with a new patcher, a new "Error system" (not really... Cheesy) and a lot of cool features. You won't have to wait long! Smiley

awesome, hopefully I'll have my new laptop by than.  Grin
11  Games Center / Archived Projects / Re: Build & Defend -- A Tale of Survival on: 2012-06-13 03:02:36
You guys should look for a stack trace by running the jar from the command line.

tried that and got an IllegalStateException in the thread "main". -> function not supported.
Must mean that your system doesn't have the right OpenGL version, get a good graphics card!

Hah, I was thinking it was probably that. And well, my vaio laptop broke a couple of months ago. So i had to dig out these desktop pieces out of my closet and build myself a crappy computer with components from like 2000-2005.

I am getting a new laptop in two weeks with Nvidia Geforce GTX or GT, most likely in the 600 or 500 series GPU and a 3rd gen intel i7 CPU or 2nd gen i5 CPU.
This laptop is going to be a beast in comparison with my old sony vaio that was running on integrated GPU and a I believe Intel duo core CPU or something like that. the clockspeed wasn't so great. Can't wait, I will massively spam these forums trying out all these demos and WIPs.  Grin
12  Games Center / Archived Projects / Re: Build & Defend -- A Tale of Survival on: 2012-06-10 01:35:46
You guys should look for a stack trace by running the jar from the command line.

tried that and got an IllegalStateException in the thread "main". -> function not supported.
13  Games Center / Archived Projects / Re: Build & Defend -- A Tale of Survival on: 2012-06-09 04:31:44
I downloaded and ran the jar, got the lwjgl frame come up, but then it just shut back down again, do I need to be using a specific version of Java? What could the problem be?

same problem over here, i click file, than a frame comes up than it closes after a second.
14  Games Center / WIP games, tools & toy projects / Re: New FPS/RPG, A Work in Progress: Dysis on: 2012-06-09 03:30:29
So while there does in fact seem to be some band named Dysis, I've already set up my Dysis webpage at, and have already built it into my story, so I will probably stick to it at this point Smiley

Well, if at some point this game gets popular and you might need to trademark the game, that won't be a problem if you do it before the band does it hah, no but actually the name is used already by some companies and it probably is registered as a trademark already. But indeed, just from that explanation you gave me, the name is fitting. But just to put it out there as game, the website could be called or ... just food for thought. Either way, keep up the good work. I look forward to a playable demo.  Wink
15  Games Center / WIP games, tools & toy projects / Re: [HARDLY WIP] WorldOfCube on: 2012-06-09 03:18:28
hello, downloading game right now, so far your progress on this game seems great. Btw, love that new lightning system you got there, it changes shape in reference to the walls, that's awesome. Keep up the good work. I'll keep an eye out on this  Wink

23 minutes have passed since I downloaded patcher, clicked download, than play after it told me to do so. As soon as i clicked play, it closed the window. How long am I suppose to wait for game to start?
16  Games Center / WIP games, tools & toy projects / Re: New FPS/RPG, A Work in Progress: Dysis on: 2012-06-09 02:55:35
amazing, I would definitely like to play this game, seems promising. Better keep an eye on this... Oh btw, did you know Dysis is the name of some musical band?
17  Discussions / General Discussions / Re: Getting myself to program.. on: 2012-06-02 02:15:03
Thanks I'll check it out. I think the main reason I have trouble motivating myself to do maths is because the maths i'm doing at the moment (adding polynomials) doesn't really seem to be any use in what I'm doing, and I know with my memory I will forget how to do it two weeks after learning it. But at the same time when ever I see an explanation of something mathmatical it usually has a formula that is complicated and I don't know what it all means, so it will probably be best I finish my algebra book. It's well written and I'm not finding it hard, but it's not as much fun as programming. I've added the book you suggested to my wishlist on amazon.

knowing polynomials and basically algebraic expressions is an essential skill for creating formulas/algorithms for your programs/games. knowing the math will save you a lot of time on certain aspects and make your program more efficient.
If you ever need any help with any of it, send me a message, I'm a college student working towards engineering major and computer science minor so I'm loaded with math, plus its what I'm best at academically Grin
18  Game Development / Newbie & Debugging Questions / Re: decompressing .JAR files on: 2011-08-03 03:05:52
I think you're being overly protective here.

Code which is obfuscated (or even decoded standard bytecode) is pretty much useless to steal anyway (unless its critical to say security or something), anyone with enough skill to use decompiled code would probably find it easier to just write their own. The main thing is the art and sounds, using a custom format pretty much stops most cases of asset theft. Lastly don't forget you have legal remedies too, such as copyright, licence, etc.

Its extremely rare that someone will steal your game and pass it off as their own, even if it does happen its usually pretty easy to figure out who the real author is. I think the harder task is writing something someone will want to steal Smiley

hmm, alright, so my inquiries are answered, with this reply and the others. I knew about obfuscating code, but I'm gonna have to take a look at that about custom formats for art and sound... alright thanks everyone.  Wink
19  Game Development / Newbie & Debugging Questions / Re: decompressing .JAR files on: 2011-08-01 01:15:31
so there is no way from stopping someone from plagiarizing your work? Like if you making a game in alpha stage, you let some people test it, one of those testers decompresses the .JAR file.  does some changes, and just says that its his. But it would be a complete copy off of mine..

Obfuscate your code. License both code and art.

is that what those companies with game engines do? License their code? how would they figure out if someone is using a genuine version/license of their engine?
20  Game Development / Newbie & Debugging Questions / decompressing .JAR files on: 2011-07-31 04:08:25
Ok so the subject title might be a bit misleading but couldn't find a better way to put it. Anyway I was just wondering, how come its so easy for anyone to decompress .JAR files with such basic tools that can be found in the internet (or an SDK and command-prompt) and just mess around with the contents, do changes, rip off things...etc. (Sort of like what people do when it comes with modding. Something like minecraft for example, that game wouldn't be so famous if it wasn't because of its huge modding community). And well get away with it?
Isn't there some way to just prevent people from decompressing a .JAR file and go poking around in there? with say, something easily accessible such as WinRAR?

21  Discussions / General Discussions / Re: I still think the anti-spam measure is an issue.. on: 2011-07-12 02:32:56
I guess it is kinda nice to find a forum that has a fair balance to its user base.  Enough people that have active unique topics, but not enough to hear programming 101 questions.

true, that's what got me into joining the forum. Seems like it has a small but big enough for my taste user base where the forum is not overwhelmed with topics. It's nice.

I remember back in my early mid teen yrs I was playing around with a C++ interpreted language game creation tool and I would visit the forums often enough to always find the same beginner questions being posted over and over again *facepalm*... gladly though a mod eventually started make a sticky of topics that answered questions that were asked frequently.
22  Discussions / General Discussions / Re: I still think the anti-spam measure is an issue.. on: 2011-07-12 01:09:43
From now on a google query won't give you the answer anymore. Smiley

Well I didn't actually think of referring to google.  Stare I started a test class, put the code snippet into a method. Started a main() method and called the other method from there and than printed it out on screen. Really simple  Undecided

So wait, you reinforced the verification page? the Answer shouldn't be the same though as people doing a "google query" could still try to plug in the answer from the old code snippet just for the heck of it. Making the new code snippet challenge kinda pointless...

23  Discussions / General Discussions / Re: I still think the anti-spam measure is an issue.. on: 2011-07-12 00:13:24
just signed up after looking around the forum. The code snippet wasn't hard to figure out. As simple as using notepad and command prompt. Took about a minute. The last line of the code snippet [ return a; ] gives it out as of what you should do.
I actually liked the mini-challenge, hah. Clueless
Pages: [1]
DesertCoockie (33 views)
2018-05-13 18:23:11

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

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

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

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

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

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

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

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

buddyBro (1065 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!