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

Author Topic: fire under spaceship  (Read 897 times)

0 Members and 1 Guest are viewing this topic.

jcoder42

  • Newbie
  • *
  • Posts: 3
    • View Profile
fire under spaceship
« on: June 06, 2018, 12:16:58 am »
hi, I am making a spaceship game and wanted to make a cool animation under the spaceship, some kind of fire or particles coming out of its rockets,
anyone have an idea of how I can do this?

Hapax

  • Hero Member
  • *****
  • Posts: 3346
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: fire under spaceship
« Reply #1 on: June 12, 2018, 12:55:20 am »
You just need a few frames of animation and then cycle those frames in a sprite. If all the frames of animation are contained on one texture, you can animate just the texture rectangle.

Using only three frames cycling, it might look a bit like this:
https://www.youtube.com/watch?v=Yjs-oRhn2fE&t=1m57s

Using Selba Ward's Gallery Sprite could help simplifying the process of animating in SFML. You simply specify where the frames are on the texture and then you can set the frame of the sprite; other than that, it's very similar to a standard sf::Sprite. See the simple example at the bottom of that Wiki page to see how simple it is to use.
The above video used Gallery Sprite. In fact, the entire video is a demonstration of some of the things Selba Ward could do at the time.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*