2D game programming in SDL - Printable Version
+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Game Programming Fundamentals (/forum-7.html)
+--- Thread: 2D game programming in SDL (/thread-2435.html)
2D game programming in SDL - Rhade - Aug 30, 2008 02:03 AM
Hi, can someone point me a way how to start programming a game like knytt with a level editor in sdl?
graphics similair to osman
I also want to use a weapon system like metroid fusion and megaman 2.
2D game programming in SDL - Terrydil - Aug 30, 2008 07:50 AM
SDL has its own 2D drawing functions but I would suggest looking at OpenGL and using textured quads (sprites).
http://www.libsdl.org/ SDL homepage
http://nehe.gamedev.net/ NeHe OpenGL tutorials
http://www.meandmark.com/sdlopenglpart1.html Good guide for getting started with OpenGL/SDL
http://www.opengl.org/code/ Some OpenGL reference
There are lots of examples of SDL/OpenGL stuff out there so look around at the sites above and others, consider purchasing the Red Book for OpenGL (there is an old, copy online I think), and let us know if you get stuck.
2D game programming in SDL - ThemsAllTook - Aug 30, 2008 08:05 AM
If you're asking someone to point the way to how to start, how do you know you want to use SDL? It sounds like you're too early in the process to be choosing an API.
The way you've phrased your questions implies that you don't have a lot of (any?) programming experience. Without having some grounding in reality, it's nearly impossible to understand the scope of what you're trying to do. Your questions approach it from a top-down manner, which simply doesn't work in the programming world. You'll need to start from the ground up. Once you've gotten as far as standing up a basic game application with some placeholder graphics and user interaction, details like a level editor and specific weapon system will intuitively fall into place, since they're built from lower-level concepts you'll have learned along the way.
The path from here to there depends largely on how much programming experience you have so far, your learning style, and your commitment to the project. At a glance, this doesn't look completely out of scope for a first project, though it is a bit hefty. I'd suggest starting by buying and reading this book, and writing some simple command-line applications to get familiar with C programming concepts. Once you're comfortable with that, you could start reading SDL API documentation and get a simple SDL app stood up. Once you get to that point, you should have built up enough of a foundation of knowledge that the next steps will be reasonably intuitive.
Good luck! Don't get discouraged by not being able to jump in and have your game up and running immediately. Programming is very rewarding, even when it takes months of work to see the results come to life.
2D game programming in SDL - Rhade - Aug 30, 2008 09:35 AM
Hi, my engine will look more like this game Akatsuki Blitzkampf http://www.youtube.com/watch?v=GYlsKtvFFeg.
480i for wii is the main goal, thats why i choose for sdl language.
2D game programming in SDL - aardvarc - Sep 1, 2008 10:14 AM
Terrydil Wrote:there is an old, copy online I think
A copy of the OpenGL "Red Book" (i.e., the Programming Guide) can be found at http://glprogramming.com/red/, though I'm unsure of how legal that is, and, for another thing, it's (like Terrydill said) old and outdated. As far as I know, the latest is the sixth edition, and costs a good 60 American dollars (I don't know what that is in other currencies)
On another note, you can find the man pages for all the OpenGL functions via the Terminal (/Applications/Utilities/Terminal.app) -- just type "man [function name]".
Assuming that you don't know how to use "man", the keys are quite similar to Vi; j to scroll down, k to scroll up, q to quit, / to search for stuff, N to go to the next found search item. You can always try "man man," too, but it's a lot to digest.
2D game programming in SDL - aardvarc - Sep 1, 2008 10:18 AM
Rhade Wrote:Hi, my engine will look more like this game Akatsuki Blitzkampf http://www.youtube.com/watch?v=GYlsKtvFFeg.
Listen to what ThemsAllTook said and buy yourself a copy of that K&R C book 'e posted a link to -- and don't get ahead of yourself with a Wii project. Nintendo doesn't just hand out dev kits, and I doubt if SDL is quite that portable. Start with simple command-line projects. Once you've got that "down pat", try to build a basic game engine of sorts, rather, just model a basic game structure and develop algorithms to power it.
And, like ThemsAllTook said, don't get discouraged for not having a game up and running quickly! It takes time!
2D game programming in SDL - Rhade - Sep 1, 2008 11:28 AM
aardvarc Wrote:Listen to what ThemsAllTook said and buy yourself a copy of that K&R C book 'e posted a link to -- and don't get ahead of yourself with a Wii project. Nintendo doesn't just hand out dev kits, and I doubt if SDL is quite that portable. Start with simple command-line projects. Once you've got that "down pat", try to build a basic game engine of sorts, rather, just model a basic game structure and develop algorithms to power it.
I'm not going for the wiiware, but for the homebrew channel that's my target. Super Mario War works also proper on the wii.
the engine will be like Akatsuki Blitzkampf. Is openglide right goal as language? I want to start building now a basic engine.
I will start with command line.
2D game programming in SDL - aardvarc - Sep 5, 2008 02:52 PM
The fact that I should've replied sooner aside, seeing how they -- that is, the hacker community -- has managed to get homebrew working on the Wii is pretty cool, but it'd be best if you stuck to the Mac (being as it'd be your development platform even if you chose to develop for the Wii) for now, at least.
For now, just write some simple C stuff -- though keep in mind that C isn't the only language out there -- and remember that you can very easily compile C code via your shell of choice. Just fire up terminal, cd to the directory where your code is, and type "gcc [source] -o [executable name]".
2D game programming in SDL - Rhade - Sep 6, 2008 12:38 AM
Oke, I have two weeks free now. Should I ony start with simple c and not opengl or command line? It will be developed on a macbook intel core duo 2. If I can create a team to build the engine how much time can it speed the progress for final stage?
2D game programming in SDL - Wowbagger - Sep 6, 2008 01:58 AM
Like ThemsAllTook said, The C Programming Language is a good place to start. Another alternative is Learn C on the Macintosh by Dave Mark, although I don't know how up-to-date that one is. In essence, before you get into building the more advanced types of applications, including games, you're going to want to start with making command-line programs that run in Terminal.
As for how you'd write these simple C programs, there are several different ways. You can use a text editor if you like, but personally I'd recommend using Xcode, mainly because it has a code editor that offers helpful features like syntax highlighting that can help you write your code easier. A text editor can't offer that.
If you decide to use Xcode, the easiest way to write simple C programs for OS X would be to create projects of the type "Standard Tool" (found under the "Command Line Utility" section of the New Project window in the latest version of Xcode). Your programs will print out to the console that will automatically appear whenever you compile and run your code.
If you want to use a text editor, you'd write your code, save it as a .c file, and then use GCC in the way aardvarc described.
Like I said, using Xcode is much easier, since it takes care of a lot of these things for you, but you can do it in a text editor if you like.
2D game programming in SDL - Rhade - Sep 6, 2008 03:06 AM
I'll stop working for osx programming and dev on windows with xna for xboxlivearcade.
Thanks for all the comments,
2D game programming in SDL - aardvarc - Sep 15, 2008 03:40 PM
Forget everything I said regarding feasibility of homebrew development -- Datel has (I assume) recently unveiled what I consider a homebrew developer's dream -- a so-called"GameCube/Wii SD Media Launcher". Certainly worth checking out, though I don't know if it supports the Mac or what (though I would assume that you could just use the command line to handle SD cards).