Jump to content

  • Log In with Google      Sign In   
  • Create Account


We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.

Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Member Since 05 Dec 2011
Offline Last Active Dec 16 2014 02:17 PM

Posts I've Made

In Topic: Rigidbody Attraction Orbit

03 June 2014 - 02:45 AM

Using the same way I described could be used to create a really stiff connection but it would need to be changed. It wouldn't be a solid connection, per say, but to the player it would look pretty solid, in my opinion. 


First of all, the multiplier would have to changed using an equation based on distance, instead of 3 set values so that the bodies are held at a certain distance, which would be the minimum distance. The nice thing about this method is that the minimum force required to separate the objects would be just be anything bigger than the force holding them together. 


So something like this:

if(distance < minDistance){

    force = -connectionStrength / (minDistance-distance);

else if(distance > minDistance && distance < maxDistance){

    force = connectionStrength / (minDistance-distance);

else if (distance > maxDistance) {

    force = 1/distance;


This may not work properly because you're dealing with acceleration. I think the rigid body might bounce around. I'll have to test this myself and get back to you. 

In Topic: Rigidbody Attraction Orbit

02 June 2014 - 06:13 PM

Off the top of my head, the solution I would try would be to have a constant gravitational-type force between the two objects then multiply the accelaration amount by a variable multiplier, which can be changed based on the distance from the object.


So an algorithm like this could work:

double multiplier = 1;

if(distance < minimum){

    multiplier = -1;
    //Repulsion force

}else if (distance > minimum && distance < speedUpDistance){

    multiplier = 1;
    //Strong attraction

} else if (distance > speedUpDistance){

    multiplier = 0.1;
    //Weak attraction


velocity += (multiplier/distance) * genericGravityConstant
position += velocity

It would basically get pulled towards the rigid body, then repulse, then pull again. If you take some of the momentum away each update of the simulation then it may reach a fixed resting point until as well.


Not sure if this would work, it's pretty late where I am.

In Topic: Problem with Java KeyListener

24 April 2013 - 02:32 PM

Addition to that ^


Make sure you add it to the different class's constructor (JPanel I'm guessing), not the player constructor.

Also, adding "setFocusable(true)" might fix it if it still doesn't work.

In Topic: Game dev competition this weekend

24 April 2013 - 02:28 PM

I've been wanting to participate in a Ludum Dare comp for a long time. Depending on the theme, this weekend's Ludum Dare may be my first. The trouble is that to make something good I'd need to be active throughout the weekend but I just don't have time; especially since I wouldn't be using an out-sourced game engine. I wish they'd have a week-long Ludum Dare...

In Topic: what do programmers do on their off time?

20 April 2013 - 01:56 PM

I find my self needing a break from time to time, but i also have a project im working on, with a few people involved. Now, there is no time quota its all hobbyist stuff, but i do feel the need to always be learning more about programming, since i am the java programmer, and i am fairly new, learning about programming and programming theorys and concepts for about 7 months now, and the actual syntax of the java language for 4 months now.


Now back to this break i was talking about... i use to, well play games! all the time... if i wasnt eating sleeping or trying to hack the lastest andriod, id be on My Xbox roaming the wastelands of Fallout 3(aweeeesssooommee game, my favorite... i want to create one of the likes one day) untill my eyes were bloodshot...


now i have sold my xbox because, yes i did get tired of it, and it sat doing nothing for about 6 months, collecting dust... with my new found hobby of wanting to create and program games!


but Now i find my self not knowing what to do, to relax and get my mind off the next problem at hand, or wanting to test some new code i have written down. i try getting on youtube and watching funny cat videos, epic fail compilations, or people doing this new found harlem shake(disturbing i know!) but i always end up getting sidetracked with a little voice telling me"hey, you really should learn how to do_____"<- fill in the blank". And i go and look up random tutorials on how to do, whatever i need to do at the moment for another hour, just getting my self back to the mind set of"Damn i need a break!" And the horrible cycle continues


what do you do for relaxing? I know it sounds corny but its becoming a real problem! like i really cant seem to relax like i use to. Any sugestions would be much appreciated.


Sorry for boring you with my personal life and its problems if you just dont care xD.


I'm having trouble with getting sidetracked. I still play games but my Xbox 360 is just gathering dust. I keep needing to finish playing certain games and work on important projects but I think I need a break from my PC. I want to work on these projects but I just can't bring myself to do them. I keep trying to learn new things so I don't have to work on them.