-
sprites in SDL
So someone showed me this link.
http://cone3d.gamedev.net/cgi-bin/in...s/gfxsdl/index
I do tutorials 1 and 2. Then I get ready for tutorial number 3
http://cone3d.gamedev.net/cgi-bin/in...ls/gfxsdl/tut3
I notice in the description 'Note: make sure you know c++ classes'.
Well.. I learned c first and was planning on doing c++ at some point in the future. Do I have to know c++ to know how to do sprites :(? I was really hoping that I can start messing around to make games.
-
You don't need to know how to do classes to make a sprite, but you will need to learn classes sometime in the future, and the basics of them aren't too hard, so you might want to just read up on it now.
-
What will I need to know them for? I was really planning on learning them eventually, but I just got so excited that I finally got to do graphics. I really dont want to do c++ right now =P
-
also does anyone have a link to some open source that uses sprites with just :(
-
WEll the sprites are just normal SDL_images but they use transparencies and animation. To use transparencies just look up SDL_SetColorKey(), and for animations you just draw an image on the screen and then delete it then draw another and keep doing that. It is actually pretty simple, but the guy at cone3D likes to show you a very good way of doing it.
There was an awsome site that I liked when doing sdl but sadly their servers were attacked by some crackers or script kiddies but they had had some great tutorials, IMO better than Cone3D. I would also throw you in the Direction of ZEngine a free SDL/addons wrapper that makes everything extremely simple to use SDL and the addons, but the site is temporarily down but if you ever see cozman online PM him or get his AIM SN from his profile.
BTW, there is a book on SDL if you geel you need one: Focus on SDL
Hope this helps, if yo uhave any questions e-mail or pm me.
--Sean
-
SDL in C: http://www.overcode.net/~overcode/wr...ing-update.pdf
It's called "Programming Linux Games", but you can use this book if you're programming for windows, too.
-
WAH!!!
I did the same thing the guy (or girl) at the top did and when I got to tut 3 I went ahead. I have some idea of classes structures and inheritance but I followed exactly what the tut said and it wouldn't work. It gave me:
'CSpriteBase' is used as a type, but is not defined as
'CSpriteBase' is used as a type, but is not defined as
'CSprite' is used as a type, but is not defined as
Et cetera... If anyone has had this problem and/or knows how to fix it
please tell me. I use Dev-C++ and I did do the linker thing and got the header files right, I think. I included:
<iostream>
<string>
<stdio.h>
<stdlib.h>
<SDL/SDL.h>
Anyway thanks in advance.