• Create Account

# CryoGenesis

Member Since 05 Dec 2011
Offline Last Active Apr 12 2015 11:35 AM

### In Topic: Killer game programming in java

10 January 2015 - 01:57 PM

Killer Game Programming in Java has a bit of useful beginner information in it but I would just avoid it now because of its age. I bought it two years ago and it was out-dated then. The entire 3D section is a bit useless now, unless you want to use Java3D.

Having trouble remembering good beginner books.. A good way to learn game development would be through a Youtube video series. It's almost like having a teacher. TheCherno has a big Java game development series which goes over the same kind of stuff Killer Game Programming does (game loops, graphics, input, etc). It's a 112 episodes so I imagine it goes over all the very basics of game development.

On another note, touching up on your maths would be a good idea if you're just starting out. There's a whole lot of mathematics when it comes to game development (especially with the graphics programming).

Have fun learning gamedev

### 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...

PARTNERS