Featured games (79)
games approved by the League of Dukes
Games in Showcase (476)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (533)
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  Game Development / Game Mechanics / Re: Simple 2D collisions on: 2012-03-18 05:03:48
Lol, I'm working on it! Cheesy stuff keeps coming up, but I'm making steady progress Shocked)
2  Game Development / Game Mechanics / Re: Simple 2D collisions on: 2012-03-17 22:42:48
Hey! I'm glad I decided to look at this post again, i wasn't expecting more comments! xD This site never emails me Tongue

Alright! So finally what I ended up doing is bugging a family friend who also happens to be a mathematics professor at a local university to help me. He did the equations while I translated it into code, and it turned out to be relatively simple once you understand it.

If ball B has a speedX and a speedY, and ball B also has these, then when a collision occurs (they're circles, use the distance formula) you simple set A's speed variables equal to B's speeds, and then set B's speeds to what A's were before you changed them. This is assuming identical mass, if one is twice as heavy you just have to use multiplication.
A.mass = 1;
B.mass = 2;
A.speed = B.speed*2;
B.speed = A.PreviousSpeed/2;

This is a mathematically perfect algorithm assuming no friction, spin, damping, speed averaging, or invading aliens. It's more accurate for atoms than superBalls cause more stuff gets in the way when things are bigger. Hope that comes in handy!
3  Game Development / Game Mechanics / Re: Simple 2D collisions on: 2012-03-07 14:38:53
Hmmm.... that might actually work. I would put in an auxiliary method to mess up the vector of the larger particle a little bit and make it look more believable, but I think that could work... I'll give it a try after school! Thanks!  Grin
4  Game Development / Game Mechanics / Re: Simple 2D collisions on: 2012-03-07 06:11:24
Right, it's like Al3x said, I need to get the direction aproximantly right. It's for a game, so as long as the player thinks it's realistic it's good enough :oP
5  Game Development / Game Mechanics / Simple 2D collisions on: 2012-03-05 22:42:07
Hello all! I'm trying to write a java program that, as simply as possible, simulates Brownian motion. In essence, there will be a bunch of circles with different velocity and mass, and I need to know what happens when they hit each other. Detecting the collision is simple, since they are all circles and you can just use the distance formula to see if they're touching, but as for exactly what they do once they touch, I'm somewhat lost.

I know this has been done before, but I can't find any code for it. Also, I'd like to avoid using a clunky physics library, as there could be hundreds or circles at once and I'd like to keep the program running smoothly.

Thank you!
6  Games Center / Archived Projects / Re: Anaconda other A on: 2011-03-16 03:54:41
Thanks! I'm glad you enjoyed it  Grin
7  Games Center / Archived Projects / Re: Anaconda other A on: 2011-03-16 01:54:40
Oh, that, you don't have to anymore. Lol, sorry, that was sort of the default....
8  Games Center / Archived Projects / Re: Anaconda other A on: 2011-03-15 22:23:50
I tried extending JApplet, and it ran, but there were no graphics. In the mean time, there should be a .jar demo download available within the hour. An applet version will follow, and thanks for the help!
9  Games Center / Archived Projects / Re: Anaconda other A on: 2011-03-15 21:38:46
Thank you for that, I'm actually working on a demo, but was putting very little effort into it because I figured people didn't care. Now I know they do, I will devote my full attention to it. Could you recommended any tutorials for converting existing .jar files into applets?


10  Games Center / Archived Projects / Anaconda other A on: 2011-03-15 18:19:54
Hey folks! I'm half of a two man game design team, trying to get the word out about our existence. I found this wiki, which looks pretty awesome, and thought "this looks like a good place!".

You should definantly come see our website! It's at and although we only have one game for sale as of now (Anaconda other A), it's super mega awesome fun-fun addicting!  Grin I've also been looking at some of the other games on this site, and some of them are pretty sweet!  Cheesy

Drop by our website! And I look forward to trying some of the other games on this page!
11  Game Development / Newbie & Debugging Questions / Re: Problems with online multi-player on: 2010-12-02 23:20:29
But what about other people who play the game? Will I have to include directions for changing router settings? If thats the case it might be easyer to change the code in the long run.
12  Game Development / Newbie & Debugging Questions / Re: Problems with online multi-player on: 2010-12-02 22:11:17
I'm using TCP, which I guess means a lot of overhead form error catching. I have yet to look into configuring my ports, but in the mean time how would I go about switching to UDP? Also information on port configuration would be appreciated.
13  Game Development / Newbie & Debugging Questions / Re: Problems with online multi-player on: 2010-12-02 19:46:22
Thank you very much, this seems promising and I will be sure to persue it. In the mean time though, everything I know about routers I learned in a basic computer science 101 class, which I took a couple of years ago as a high school guest student, so I'm not really sure how they work. After lunch I will try and find out things like weather I'm using UDP or TCP, but as of now I don't even know what those stand for. It shouldent take to long to study up on it though, I've still got my textbook and google is on my side.  Grin
14  Game Development / Newbie & Debugging Questions / Re: Problems with online multi-player on: 2010-12-02 18:56:04
None of the errors are network related and  the errors generated by the graphics section don't normally appear. also they originate in the Graphics library, not in my code, which leads me to believe that they aren't really to do with graphics, but are rather a by-product of the Main thread crashing.

my command prompt won't let me copy past but the errors start out with things such as "java.awt.event.InvocationEvent.dispatch< Unknown source>" and "javax.swing.RepaintManager$Paintmanager,paint< Unknown suorce>" and "exception in thread "AWR_EcentQueue_0" java.lang.nullPointerException"

It is worth noting that the most recent time I ran the game, it was perfectly playable for all of 5 seconds before it crashed. A record so far.  Undecided

As for the portion about the router, I have no idea. I probably have the default setting on everything local network related, but the game doesn't work on local networks either so idk...  Shocked

Im sorry I don't have many leads for figuring out the problem, but if I did I might have done a better job myself.   Wink

I guess I will try to explain the communication protocol I wrote... basically their is one Main thread for the host, which runs just about the same as in single player, and one thread per client which collects keystrokes from clients. The Main thread than prepares an array list of custom data holding objects, sends them over the network with a few Strings as well for other info, and the client uses the data to render an image on the screen. The graphics are really simple so it just uses a for loop and goes through the data points, painting one after another. I don't think I'm overloading the network, because according to the task manager the game never exceeds 0.50% of the network capacity. also at the beginning of the game their are only 2-3 data points, even though it can get to hundreds later on.

thanks!  Grin

P.S while I was writing this another post came through, which I will now respond to. I alredy made somthing similer at the begining that tested weather the connection worked, but I guess I've chanegd alot since than, so it might be a good idea to redo that. It will take a bit of time though, so I will post the results when I'm done.
15  Game Development / Newbie & Debugging Questions / Problems with online multi-player on: 2010-12-02 17:55:16
Greetings, people of the javaGaming forum! I am new here as I have been using  different forum, but they were unable to answer this question so I came here. I am a hobbyist Java game writer and I just added online multiplayer to my most recent game, Anaconda other A, which is like snake only with a lot more game modes. When I first wrote it I thought the difficult part would be establishing a connection between two computers, and so after I had written the code that allowed two Java programs to communicate, I immediately checked if it still worked on other computers and across networks. It did, without any changes required, so I went on to finish the game without conducting frequent checks to see if it still worked on multiple computers.

        Now I have finished it, and when I run it on my computer, it works like a charm (actuly better since charms don't work  Tongue ) but when I run it on two different computers, the client crashes the moment the games starts.  Cry I am using sockets, and will post the code if requested, but seeing as it's like 900 lines long I think I won't unless you want me to. I have yet to test it on many different computers, and on the few I have tested I have noticed that some will refuse entirely to host a game, while others will only host games and wont be a client. I tried disabling my firewall, but it changed nothing, I tried reading the error messages, but they were all "unidentified" and pertains mostly to the graphics portion of the software, making vague references to the AWT thread. they were also were long and seemed to change a little each time.   Huh

        Any and all help is appreciated.  Smiley

Pages: [1]

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 (22 views)
2014-07-24 01:59:36

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

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

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

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

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

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

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

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

Riven (52 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 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!