Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: GravNav - simple glitchy planet simulation prototype  (Read 3351 times)

0 Members and 1 Guest are viewing this topic.

AniCator

  • Newbie
  • *
  • Posts: 6
    • View Profile
GravNav - simple glitchy planet simulation prototype
« on: February 04, 2013, 09:29:37 pm »
Hey guys,

My first post here on the forums after having lurked for a bit.

I started messing with SFML a few days ago and I have to say that I'm liking it so far.

After familiarizing myself with SFML for a bit I setup this little project.
Right now it's pretty glitchy and when the player crashes into a planet it actually crashes the game right now. :3

It runs in windowed mode @ 720p



Download | Public build

Issues I'm trying to work out:
  • Make new planet adjust velocity based on distance from closest planet to get into an orbit
  • Fix player crash (once I got going the code got rather messy so this pretty much equals a cleanup)
  • Drawing the trajectories (past or maybe even future) of the planets

It would be great if you guys could give me some hints as to how I can make it so a trail is drawn behind the planets to show where they have been. To sort of visualize the trajectories.
« Last Edit: February 04, 2013, 09:42:26 pm by AniCator »

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: GravNav - simple glitchy planet simulation prototype
« Reply #1 on: February 04, 2013, 10:08:34 pm »
There are multiple possibilities for a trail, what do you want it to look like?

If it's just a line, you can use sf::Vertex with sf::Lines. For a trace of the planet, you can use multiple sprites with different brightness or alpha value (the overlaps might be visible). For something very elaborated, you could use a particle system or even shaders, but it's probably not a good idea if you have just begun to use SFML.

Also, you should fix your crash first before thinking about such things ;)
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Sui

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
    • http://www.suisoft.co.uk/
Re: GravNav - simple glitchy planet simulation prototype
« Reply #2 on: February 05, 2013, 09:27:27 am »
Right now it's pretty glitchy and when the player crashes into a planet it actually crashes the game right now. :3

Perhaps this could be a feature. :-)

Kinda like permadeath, particularly if you can manage to cause a kernel fault and blue screen Windows. (Joking!)

Lines for future position and a faded sprite trail might look nice.
Gary Marples, Developer of games and other stuff.
www.suisoft.co.uk/games/BlogTwitter