In this tutorial series you will learn how to make a simple single-player Pong-like game for the Sega Mega Drive using SGDK! If you just want to see the full source code, you can get it from Github.

Megapong BONUS - Flashing!


Alright, we have a complete and working game now. We have graphics, gameplay, scores, game overs…sound is still missing, true, but that’s a topic for another tutorial. However, we can still add something to make our game a bit better: The almighty Juice.

In order to juice things up as it were, we’re going to make the ball flash when it’s hit by the paddle. It’s a small effect, but an important one when it comes to retrogaming. Hitting Robotnik wouldn’t be as satisfying if he didn’t flash, after all. So let’s do this!

images/flashing.gif
This content is a Thank You for my patrons on Patreon.

Please enter the password you received to view this content.

360J+FCI6obVm2rqDDE99XAqghd4bw3kVQuKt6qxmgqzZNMuV3weyifQ2szeJiO5IdlxwEVWVJ5JjelfU3ZjEtTlwFGv2+MVVgN9VUGVPMoqdy+vGaixboIXXz6rSXQqqFtDocSbp33UCiWyrGEdMIV1pXZIwP5K4WmmF6ByL6Wm9Ss1TcpE32eVomMzRVQusbp2/IFZmznRyylkn5eKXjyk5sJgitiAREuUGfzxKjueY2bs5/sp02aoMQpJVJc9nq5LZ6xL9cHyXdmMjOmJ4hmbbSrdGmKqXXSM3cNkJuUh2OSpuc3561rI3pm4FnfR7+jq3AiqZzZr+JdG3RYxhcBZH4DXUrK8/wZPXKT+ZuMeMpbnnagbPjXjsx0OIHUa5dezR/xr+1svMM+2ATyQD1vR/EyIA0rjzDkt5YfaNazLXwZ/KKcvz492jVZLefN9Yf/7Kunom9bPgxgxAuoPnUX1SYOBNpe1HWGSlKtgYU1ao4bO6JSkiI4FIPglw1qOYPuy0gPr/p5tVWk7qaJZJ/HHdUUIOtPaHJMiUTH+3TKxakADaMayYJgx4oTatiIy6P4IOT41QT3RmxRU0Ac5Puar4q4gHeERRus0W1oi/PE9dyFeiFM99yGt9lVHahkFYAccc3n0oZTjaXmXMUKLwQki6fIdAF/VgUwKoRztHtSUtcjltOu1lBjV+bzbLmpVDvA5oAU4hfR17j+UvFSghKa7BmAqTRIPNUtW7da1itHnrRwjV1d7iBIFL4B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QQzV+wgjCA28OXf8z9ahjeUJpxv07a+ZhP0anrmW8v7ZTnxxDoTp2lyyi+cBY13o3gA5C8VHbNRygZYB4R8PDyxDejZOrOUUehRlu+e2imBGrFUwwkCekGH5B1I98upUnGEP4HRTNOcBj+rzn0A7Wv9XsE+e/wany73OSiY/qgef6FG/wlnesVfADF0crB5Go7BMTByUn8XaNsjBJZ8YiSS6pjc7TDik5ogl3/K24N+zk4K+dJA+RkKxDm72a4OtEIlbA4vbqC/NzD8J66FzI84IeKjCR4tSkDa7JR1uTYvdFGkkBnT9WC1zkCUEgKN7YSswWOqCFlLrK0XChcmxbZkrDspvYVDbN6Yt13TsHPeiES0036Q/f3ovzYKbJBjT103u5b735heb0HrJII0tYBgI=

If you have any questions, comments or criticism, post them in the comments below or reach out to me on Twitter @ohsat_games! Special thanks to Stephane Dallongeville for creating SGDK and everyone in the SGDK Discord for their help and keeping the dream alive!

Take It to the Next Level!

Want to boost your Mega Drive coding skills? Get exclusive bonus steps and project files for each tutorial by supporting me on Patreon!

Become a Patron!
Just Want to Buy Me a Coffee?

Check out the rest of this tutorial series!

  • Megapong 1 - Hello Mega Drive World!
  • Megapong 2 - Setting Up The Environment
  • Megapong 3 - Importing Resources
  • Megapong 4 - Palettes
  • Megapong 5 - Sprites
  • Megapong 6 - Input and Paddles
  • Megapong 7 - Collisions
  • Megapong 8 - Score and HUD
  • Megapong 9 - Game Over
  • Megapong BONUS - Flashing!
  • Get Words in Your Inbox!

    Be oldschool and sign up for my newsletter to get updates! Just enter your email address, prove you're not part of Skynet and you're good to go!



    Powered by CleverReach. I will not send you spam or sell/give your email address to someone else.  You can of course unsubscribe at any time. By clicking the subscribe button above, you confirm that you have read and agreed to our privacy policy.

    By using the Disqus service you confirm that you have read and agreed to the privacy policy.

    comments powered by Disqus

    Related Posts

    Streets of Rage 2 Design Docs

    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.

    Read More

    Make a Space Shooter for the Mega Drive!

    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.
    Read More

    Patreon Revamps

    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.
    Read More