Tutorials/code examples?

SGDK only sub forum

Moderator: Stef

Post Reply
Kuroto
Interested
Posts: 46
Joined: Sat Mar 02, 2013 4:34 pm

Tutorials/code examples?

Post by Kuroto » Sat Mar 02, 2013 4:51 pm

Hi all,

I'm new on this forum, although i have been lurking around for a while. :)
I've just started genesis dev. Set up Code::Blocks with SGDK and i've been playing around a bit.

I managed to show a picture of my dog on the megadrive following the "moon" tutorial on the SGDK wiki, and i've managed to read inputs from the controller.

However, i was wondering if there are some more tutorials or code examples i can study?

I would love to make a small demo on the MD/Genesis, and afterwards maybe start on a simple game.

I'm also learning C by doing this. My programming knowledge consists of REAL Studio (kind of comparable with VB.net) and a bit of PHP and JavaScript.

I did try basiegaxorz but it seems like it's a bit too limited, and i would love to learn a higher level language for Genny development.


TL;DR: Need more tutorials and/or code examples. Anyone here that knows where i could find those things or are willing to share some basic examples for me to study?

Thanks in advance!

Steve

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Sat Mar 02, 2013 6:57 pm

Here are suggestions for SGDK examples :
- you can look at samples provided with SGDK (in the sample directory).
- look the propeller engine, a complete 8 ways scroll game engine :
viewtopic.php?t=1373
- look over various examples on spritesmind, specifically in the demos section :
viewforum.php?f=8
- look into the doc directory of SGDK, it includes a doxygen documentation which describe each method (or almost) of SGDK.

Kuroto
Interested
Posts: 46
Joined: Sat Mar 02, 2013 4:34 pm

Post by Kuroto » Thu Mar 07, 2013 3:09 am

Ah yes, that's a great start.

Thanks for the help, Stef.
BTW, great job on the SDK!

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Thu Mar 07, 2013 9:24 am

Thanks :D sorry to not have much more than that right now.
At some point i would like to do a real guide for SGDK, just need to get motivation ^^
Look like there is more and more developers interested in Sega Genesis programming lately and that is really cool :)

Kuroto
Interested
Posts: 46
Joined: Sat Mar 02, 2013 4:34 pm

Post by Kuroto » Mon Jul 15, 2013 11:49 pm

Hi,

So i've been trying to wrap my head around the samples and the Propeller engine.

A lot of files in that last one, so i can't really make out what does what i'm afraid.

Also, is it possible that there's something wrong with the ZIP files in the SGDK wiki? Most of them show up as empty when i download them.

I'm trying to show a sprite onscreen that i can move using the D-pad. I would love to build a simple shoot 'em up (like R-Type and the likes) as my first "real" project. :)

Any more examples available by any chance?

Thanks in advance!

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Tue Jul 16, 2013 9:47 am

Hey,

Propeller is indeed a complete game engine and may be too much to start with but still it can be really interesting to dig in some specific part you are interested in. I checked the tutorials zip files, they do not show any files with the default windows dezipper but they do unzip correctly with 7zip for instance so files are definitely presents :)

If you are interested in, here is a very basic shoot attempt i did :
https://www.dropbox.com/sh/gvfa9xrx18cpuii/LzPf2lJK23

It's pretty incomplete, not optimized... but basically i just wanted to show a small game sample (which i never completed), maybe i will complete it in future if time allow it... The music comes from Shiru by the way.

Kuroto
Interested
Posts: 46
Joined: Sat Mar 02, 2013 4:34 pm

Post by Kuroto » Tue Jul 16, 2013 10:40 am

Thanks, Stef!

Looks really interesting. I tried compiling your example from source, but it seems the .h files are missing. Is there anything i need to do before compiling?

Please bear with me, i'm completely new to the C programming language, so i'm trying to figure stuff out along the way.

So first of all i'm trying to figure out how your shooter example works internally, how it's built up, etc. After that i'm going to start from scratch on my own game. :)

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Wed Jul 17, 2013 10:03 pm

Oh sorry indeed include (h) files from 'res' were missing (they are in 'res' directory as this is generated files), i just added them. You should be able to compile the project easily with the default SGDK makefile (makefile.gen) :)

Kuroto
Interested
Posts: 46
Joined: Sat Mar 02, 2013 4:34 pm

Post by Kuroto » Mon Jul 22, 2013 9:50 pm

Allright! Thanks!

So i've managed to add a crude and simple scoring system to your example. I did notice that it's slowing down quite a lot, especially when the third "weapon" is being used.

Any ideas why?
Also, would you mind if i build a complete game around your example? I think that's the best way to learn for me to be honest.

Offcourse, if i would ever release a game, you'll get a LOT of credits, not only for making such a fine example, but also for building such an awesome SDK :)


I'm going to see if i can add some simple parallax scrolling background to it as well.

-Steve

Kuroto
Interested
Posts: 46
Joined: Sat Mar 02, 2013 4:34 pm

Post by Kuroto » Mon Jul 22, 2013 9:59 pm

Nearly forgot. Here's the ROM :D

*click*

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Mon Jul 22, 2013 10:44 pm

Oh yeah it slows down quite a lot because i did not made any optimization at all and also because of the naive collision implementation. I did not even remember about the different shoots :p The third one is intended to be an auto aimed weapon, for each shoot i find the closest enemy around and try to reach him... actually i never completed the code as it does not seem to work X'D

Well done for the score by the way, as you said now it may need a background ;) No problems for building a complete game around the example but honestly that would require lot of rewrite to improve the whole structure and remove slowdowns :p

Post Reply