What does this mean for me? You will always be able to play your favorite games on Kongregate. However, certain site features may suddenly stop working and leave you with a severely degraded experience.
What should I do? We strongly urge all our users to upgrade to modern browsers for a better experience and improved security.
We suggest you install the latest version of one of these browsers:
Kongregate is a community-driven browser games portal with an open platform for all web games.
Get your games in front of thousands of users while monetizing through ads and virtual goods.
Learn more »
I’m working on a game for my programming class and I came across a topic that I honestly don’t know how to approach. You all know the game Gravitee by FunkyPear right? well my game is in a solar system with planets much like the ones in Gravitee, and you fly around in a ship, defending your planet from alien invaders. I wanted to add a trajectory line for your ship, and the bullets that are being fired, but I don’t know how to draw this line on the screen/calculate it. Any help is greatly appreciated.
If you have more than one gravity well, predicting the projectile path with pure math equations is going to be really quite challenging.
I would use an iterative approach. Run a quick simulation to work out where your bullet will go, using the same calculations you use in your game loop. Add all the points to an array, and draw a line through them.
> *Originally posted by **[CuriousGaming](/forums/4/topics/323495?page=1#posts-6807164):***
> Add all the points to an array, and draw a line through them.
It would be better to draw the line while you are simulating the projectile. Also, if this applies to your game, only simulate the path when you changed the aiming angle to avoid unneccesary performance loss.