Animation tutorials?

Hi,
I’ve (finally) got round to compiling the SDL support libraries (image,
mixer, etc.) for mingw32 - they all seem to work and I’ve been able to blit
stuff (a red ball) onto the screen surface.
Of course, having a single red ball doing nothing particularly interesting
is… well… boring. I’d like to animate the ball - move it around the screen,
make it change colour, spin, something like that. My problem is that I can’t
find any decent SDL tutorials that cover animation.
Does anyone know of any tutorials that cover the absolute basics of
animation with SDL (keeping things running at the proper speed would be a
good start)? I did find one a while ago, but the code seems to be totally
uncommented and I’ve lost the URL for the tutorial :frowning:

Thanks.–
Phil. | Acorn Risc PC600 Mk3, SA202, 64MB, 6GB,
philpem at philpem.me.uk | ViewFinder, 10BaseT Ethernet, 2-slice,
http://www.philpem.me.uk/ | 48xCD, ARCINv6c IDE, SCSI
… Tiger! Tiger! Burning bright. Who has set your tail alight?

Hi,
I’ve (finally) got round to compiling the SDL support libraries (image,
mixer, etc.) for mingw32 - they all seem to work and I’ve been able to
blit
stuff (a red ball) onto the screen surface.
Of course, having a single red ball doing nothing particularly
interesting
is… well… boring. I’d like to animate the ball - move it around the
screen,
make it change colour, spin, something like that. My problem is that I
can’t
find any decent SDL tutorials that cover animation.
Does anyone know of any tutorials that cover the absolute basics of
animation with SDL (keeping things running at the proper speed would be a
good start)? I did find one a while ago, but the code seems to be totally
uncommented and I’ve lost the URL for the tutorial :frowning:

Thanks.

Hmm, well I’m sorry I can’t point you to a C tutorial. I assume that is
what you’re looking for. I would like to mention pygame,
http://pygame.org, with which you can create SDL-powered games/etc in
Python. It should be about the easiest way for you to experiment with
animation and so on, and you can translate what you learn to the C world
if you want to. Oh yeah, and it’s lots of fun!

-EricOn Sat, 16 Apr 2005 01:31:36 +0100, Philip Pemberton wrote:

YEARS ago, I did a 2-part talk on SDL for my Linux User Group.
Some of this might still be relevant, and it’s all insanely basic.
(Probably better than saying “just go look at the source to [some SDL game]”,
since the code wouldn’t be written in such a way as to be a tutorial.)

http://www.lugod.org/presentations/sdl-talk-1/
http://www.lugod.org/presentations/sdl-talk-2/

Use the arrow graphics at the tops of each page to proceed through the HTML
slides.

Enjoy.On Sat, Apr 16, 2005 at 01:31:36AM +0100, Philip Pemberton wrote:

Does anyone know of any tutorials that cover the absolute basics of
animation with SDL (keeping things running at the proper speed would be a
good start)? I did find one a while ago, but the code seems to be totally
uncommented and I’ve lost the URL for the tutorial :frowning:


-bill!
bill at newbreedsoftware.com Tonight’s Forecast: Dark. Continued darkness
http://newbreedsoftware.com/ until widely scattered light in the morning.

Oh, and of specific interest may be my “Balls Demo”, in which you can:

Left-click to add bouncing balls
Right-click to add pegs for the balls to bounce on
Hit [Space] to 'pause’
Hit [Tab] to remove all pegs

Here’s a screenshot:

http://www.lugod.org/presentations/sdl-talk-2/balls.gif

Here’s an HTML page that contains pretty looking source code:

http://www.lugod.org/presentations/sdl-talk-2/20.html

The /actual/ source from part 2 of my talk, which should also include a
Makefile, the BMPs and the WAV file used in this demo, are here:

http://www.lugod.org/presentations/sdl-talk-2/sdl-talk-2-examples.tar.gz

Have fun! :slight_smile:

-bill!On Fri, Apr 15, 2005 at 07:22:36PM -0700, Bill Kendrick wrote:

YEARS ago, I did a 2-part talk on SDL for my Linux User Group.

In message
“Eric Mangold” wrote:

Hmm, well I’m sorry I can’t point you to a C tutorial. I assume that is
what you’re looking for. I would like to mention pygame,
http://pygame.org, with which you can create SDL-powered games/etc in
Python. It should be about the easiest way for you to experiment with
animation and so on, and you can translate what you learn to the C world
if you want to. Oh yeah, and it’s lots of fun!

Hm. I think I’ve learned enough programming languages for one lifetime…
BASIC (QBASIC, Visual BASIC and EhBASIC), Pascal (Delphi, Borland and Turbo),
C, C++, PHP… I really don’t feel like learning Python unless it’s almost
identical to C or PHP.

Later.–
Phil. | Acorn Risc PC600 Mk3, SA202, 64MB, 6GB,
philpem at philpem.me.uk | ViewFinder, 10BaseT Ethernet, 2-slice,
http://www.philpem.me.uk/ | 48xCD, ARCINv6c IDE, SCSI
… Mary had a little lamb. The doctor was surprised.

In message <20050416022236.GA2814 at sonic.net>
Bill Kendrick wrote:

YEARS ago, I did a 2-part talk on SDL for my Linux User Group.
Some of this might still be relevant, and it’s all insanely basic.
(Probably better than saying “just go look at the source to [some SDL game]”,
since the code wouldn’t be written in such a way as to be a tutorial.)

That looks pretty useful - thanks Bill. I’ll have a look at it over the next
few days (assuming I can find some spare time)…

Later.–
Phil. | Acorn Risc PC600 Mk3, SA202, 64MB, 6GB,
philpem at philpem.me.uk | ViewFinder, 10BaseT Ethernet, 2-slice,
http://www.philpem.me.uk/ | 48xCD, ARCINv6c IDE, SCSI
… Don’t dispute death unless you’ve lived through it.

Hm. I think I’ve learned enough programming languages for one lifetime…
BASIC (QBASIC, Visual BASIC and EhBASIC), Pascal (Delphi, Borland and Turbo),
C, C++, PHP… I really don’t feel like learning Python unless it’s almost
identical to C or PHP.

Well, with all that languages under your belt, you surely can look at
code written in a language that uses a paradigm known to you (object-
oriented + a little bit of functional) and see not the code but the
techniques!

I know a guy who’s been a professional programmer for years (mostly does C/C+
+, but I believe he has done a bunch of other stuff over the years). He’s
recently “discovered” Python and is lovin’ it more and more. :slight_smile:
Python is the only language I’ve learnt so far, so I’m probably a little
biased towards it. :slight_smile:

-Matt BaileyOn Monday 18 April 2005 21:54, Gabriel wrote:

Hm. I think I’ve learned enough programming languages for one lifetime…
BASIC (QBASIC, Visual BASIC and EhBASIC), Pascal (Delphi, Borland and
Turbo), C, C++, PHP… I really don’t feel like learning Python unless
it’s almost identical to C or PHP.

Well, with all that languages under your belt, you surely can look at
code written in a language that uses a paradigm known to you (object-
oriented + a little bit of functional) and see not the code but the
techniques!