Results 1 to 4 of 4

Thread: Sprite Rotation?

  1. #1

    Exclamation Sprite Rotation?

    Hi, first of all I'm new here, so hi everyone!

    second of all, I'm needing some quick help, I'm trying to create an asteroids game, I've struggled understanding some step by step guidelines to rotating a sprite I have (which is a seperate class).

    I was told to create a member in my sprite called float rotation, and from then on I just get confused!

    If anybody is willing to help I'll send you my "attempt" at getting this right.

    Thanks, this would be a great help as I am sick of struggling with this!

  2. #2
    Hi and welcome to the PGD!

    First of all give us more information - wich engine(or API?) do you use and what kind of problem did you got - rotating the sprite or moving it using new rotating angle?

  3. #3
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    If you want SDL rotation in simple terms then look no further:

    Code:
    Destination_Surface:= rotozoomsurface(Source_Surface, Degrees_Counter_Clockwise, Scale_Factor, Quality_Level);
    For the fastest (low quality) rotation set Quality_Level as 0 because it can be a little slow.

    Its an sdl_gfx procedureso you would have to
    Code:
    uses
       sdl,
       sdl_gfx;
    Of course that assuming you're using sdl/sdl_gfx. Although if you are looking at creating an asteroids game from step-by-step tutorials and this is your first programming attempt I am working on a project called the Prometheus project - at the moment the only useful units are core and video as audio needs a lot of work but it's aimed at beginners so it has simplicity and some speed in mind . Just a suggestion.
    Last edited by code_glitch; 05-01-2011 at 05:41 PM.
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

  4. #4
    Thanks for the help even though I stupidly forgot to say what programming language I was using, I was using visual studio 3.0 C#.

    I figured out rotation eventually but thanks anyway!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •