Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 21 Nov 2012
Offline Last Active May 24 2016 04:50 AM

#5179360 [2D]Make a camera follow multiple characters.

Posted by on 10 September 2014 - 10:28 AM

EDIT: Actually, the code snippet posted above by Kryzon works fine, thanks again for all the help.

The problem was in the casting. For example, (float)( stage.visibleWidth / stage.visibleHeight), these are two ints that are divided. The results, which is also an int, is then casted to a float, which is wrong.

#5176204 [2D]Make a camera follow multiple characters.

Posted by on 26 August 2014 - 09:26 AM

Thanks for the help.


I guess the bounding box is the total size of a stage?


How do I compare the aspect ratio? Sorry, bad at math.

#5140126 Getting a direction constant from normalized vector

Posted by on 18 March 2014 - 02:59 PM

Thanks all. C0lumbos code works fine and is most likely the fastest and have highest readability. 


My math skills are very limited so I do not understand many terms and such used here, but I trying :)

#5048324 Pixel Perfect collision with rotation support?

Posted by on 30 March 2013 - 09:09 AM

Anyone know how to make a pixel perfect collision function that supports rotation of the sprites?

This is for a 2d game.


I have a feeling this is a performance killer.

#5044076 Largest square that fit inside a circle

Posted by on 17 March 2013 - 05:48 PM

Thanks all!

#5043103 Distance between two entities decide volume of a sound.

Posted by on 14 March 2013 - 11:28 AM

If you are talking to someone that is far away from you, you wont hear anything. As you move closer to him/her, the sounds becomes clearer and stronger.

I want to implement a logic like this in my game.

#5043097 Distance between two entities decide volume of a sound.

Posted by on 14 March 2013 - 10:51 AM

I need help with an algorithm for my 2D Game.


Say entity AA is emitting a sound. The strength of the emitting sound is determined by the distance between AA and BB(this could be the main character).

The further away they are, the weaker the sound is. The max distance(pass this distance and the sound volume is 0) is of course customizable.

The volume setting can be from 0.0 to 1.0.


Where and when to do these checks is not a problem. I know my engine and I can resolve that. How to check it is the problem.

#5026017 Very Basic Question about classes

Posted by on 27 January 2013 - 05:21 AM

Maybe you should get better at programming(a lot better) before start developing a game, which is a hard task.

#5025583 Pushing objects

Posted by on 25 January 2013 - 04:53 PM

You want to provide more details and information.  In short all we can do right now is say "When the two objects are touching have them move together".  You might also want to take weight into account and slow down the movements to simulate the first object struggling to move the second.

So say A is pushing B. If A is coming from the left, upon collision it will push B to the right.

If A is coming from above, it will push B downwards.


This quickly becomes pretty complex if you have multiple objects, where you can push an object which pushes another object and so forth. You're verging into full physics library territory here, so I would recommend you look into using an existing 2D physics library such as Box2D or Squirrel. Hooking up to these libraries is very easy, and they provide decently robust physics under a free license.

My game is not going to support multiple objects pushing each other. Integrating my game with a 2D physics library is just to much work for such small game. It would be like putting a 500 horse power engine in a piece of junk from the seventies.

#5020070 error trying to setup slick2d with eclipse

Posted by on 10 January 2013 - 05:20 PM

There is a excellent mini series on youtube explaining how to set it up with eclipse and how to use it.

Part 1 of the series: