Tag: Mega Drive
This is a list of all posts, games and tutorials tagged with the tag "Mega Drive".
Game states (sometimes also called scenes or screens) are an important building block of games. Well, at least they should be. They not only serve to make code more maintainable and better structured, they can also help with resource management and performance. After all, you don’t need to have the boss sprite in RAM while the player is in the options screen, right? In case you’re not quite sure what a game state is: Think about pretty much any video game.
Has this happened to you? You spend days crafting and coding an amazing Pong game for the Mega Drive. You create artistic, beautiful graphics, use highly advanced coding techniques and magical algorithms, and have composed a soundtrack that sounds like Streets of Rage as arranged and conducted by John Williams. Then you compile the game, fire it up in your emulator and see this: That just ruins the whole thing, doesn’t it?
A few years ago, Yuzo Koshiro posted a pile of old game design documents for Bare Knuckle 2 aka Streets of Rage 2 on the Ancient blog to commemorate the release of Streets of Rage 2 3D on the Nintendo 3DS. These documents gave a deep insight into the game’s inner workings, technical aspects, designs and even some cut content. They were an awesome resource for one of the most awesome games ever created.
In space, no one can hear you scream. But you can hear lasers, explosions and video game beeps. That’s just science.
So far our game has been rather quiet. So let’s add some sound to it to spice things up! What would a classic shmup be without beeps and bloops after all?
We have enemies and bullets flying around on screen, and now it’s time to smash them together! Shooting enemies will award the player with points, so we will also implement a HUD that will show the current score, as well as the number of enemies left. Let’s get into it! Collision All collisions in the game will be handled in one big function. This function will loop through all bullets and all enemies to see if any of them collide.
Let’s lock and load to shoot some space scum! This time we’re going to create a pool of bullet entities, out of which we’ll grab a bullet to launch at our enemies. Let’s get shootin'! Bullets First of all we’ll of course need a bullet graphic. Download it using the link below, extract the archive, then put the image in res/sprites. Download bullet sprite Then import the bullet image by adding this line to resources.
Now we have enemies, but they’re not moving. That’s not really intimidating, is it? Also, our player can’t move either. Let’s change all that so that we can actually interact with our game! Moving the Enemies First a quick bit of setup. At the top of main.c add these two defines: #define LEFT_EDGE 0 #define RIGHT_EDGE 320 These will define the left and right edges of the screen. It’s good to use defines (or variables) for these values, so that we can easily change the bounds of the play area later on.
Last time we defined a struct of type Entity and used it to create a player. Now it’s time to throw some enemies into the fray! It ain’t a shooter without somethin' to shoot at, after all. Luckily our Entity struct will make that rather easy for us, because this way, each entity will keep track of its own position, velocity and other values. And to be extra lazy clever, we’ll put all enemy entities into an array, so we can deal with them more easily in bulk.
It’s time for another SGDK tutorial series! After doing a single player Pong game and an endless runner, it’s time to reach for the stars… and make a space shooter! Apart from things like scrolling and animating sprites, this new series will show you how to deal with multiple entities and their collisions, how to randomly generate backgrounds and more! This project builds upon the previous tutorials, so if you’re new to SGDK programming and have not done those yet, I highly recommend starting with Megapong.
Alright, last time we created some scrolling space. But we’re not making a screen saver here! We’ll need entities to populate our game, entities to shoot with and entities to shoot at. We could define all of those manually, which would look a little something like this: int player_x; int player_y; int player_velx; int player_vely; int player_health; int enemy1_x; int enemy1_y; int enemy1_velx; int enemy1_vely; int enemy1_health; int enemy2_x; int enemy2_y; int enemy2_velx; int enemy2_vely; int enemy2_health; int enemy3_x; int enemy3_y; int enemy3_velx; int enemy3_vely; int enemy3_health; //And so on and so on.
Last Updated: Dec 20 2021 Update: Changed the offset check to offset <= -256 as pointed out by Pyxel Pub (see comments below) Welcome to another new project tutorial series on Mega Drive development! This time we’ll be creating a space shooter from scratch using SGDK, the Sega Genesis Development Kit. This is what the end result will look like: It’s a very basic take on the genre.
Making art is hard, but retro consoles make the job even harder due to technical limitations and restrictions, such as a limited color palette. You have to keep these things in mind from the very beginning, before you even place your first pixel. Only practice makes perfect, but the graphics software you use can make your job easier…or maybe even harder! So in this post I wanted to give you a list of 4 graphics programs that you can use to create graphics for your Mega Drive game.
Hey there, what’s up? Things are continuing to evolve, as I’ve now updated my Patreon to give patrons more perks! Apart from early access to new tutorials and posts, the biggest one is probably the ability to peek behind the scenes…and there will be a lot to peek at in the coming months! This year I’m writing and submitting my MA thesis, meaning that I will have to do more stuff to make ends meet.
Having to use palettes is one of those things that seem like a restriction at first, but… well okay, it is a restriction. But palettes can also be a powerful tool if you know how to use them right. One very simple but effective thing you can do is color swapping. How does it work? The Mega Drive uses a palette of 64 colors that is shared among all visual assets in a game.
One of the cool things that VSCode offers is the support for extensions. And there are a ton of them. There’s pretty much one for every occasion, and if there isn’t, there probably will be soon. And since we use C, an absolute classic of a programming language, there are also some that can help us out with Mega Drive coding!
We have obstacles and the player can jump over them, but it doesn’t really matter…you don’t get rewarded when you do and you don’t get punished when you don’t. So let’s add a scoring system and collision to the obstacles so that there’s actual motivation to do things! Collision First we’ll take care of the collision detection. Go down into your main game loop and add the following if-statement after the code that moves the obstacle across the screen: