Let's make a game in C++ (SDL,OpenGL) - Episode 10 - Adding features

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
5,766
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Jun 6, 2011

I have decided to start a "Let's make a game" tutorial-like video series. In the series I will show you how to make a game from scratch in C++ using SDL and OpenGL.

Next video:
http://www.youtube.com/watch?v=6p-fyKva4QY
Previous video:
http://www.youtube.com/watch?v=bBm0pGwiyYE

Episode 10 - In this episode we add more features to the game. First we add images for all of the objects, then we do dynamic ball bouncing and for the end we check if we have destroyed the bricks

NOTICE: Forgot to increase the font size again. But I am using a more readable font now and you should read the code without a problem in HD. Thanks

Code:
http://pastebin.com/AB2uBeGz

Images:
http://www.mediafire.com/?3q6whwpbiwvholt

For additional info about SDL programming:
http://www.lazyfoo.net/SDL_tutorials/index.php

My blog:
http://www.redgamedevblog.blogspot.com/

My Twitter:
http://twitter.com/includeLuka

Please give feedback

Link to this comment:

Share to:

Uploader Comments (RedReaper132)

  • Turns out the problem is with libpng although I've linked it correctly with code blocks. Do you have any ideas on how to fix it? Thanks.

  • @Thecawesomeone Did you also add zlib? It's hard to tell why it doesn't work.

  • I got a question...

    Why haven't you just made the drawing a function?

    Like...

    DrawTexture(TEXTURE, COLOUR, X, Y, W, H);

    Etc ?

    I'm going to do that now... :D

  • @ShadowSky24 I didn't want to complicate too much with functions. If you want to, then make one for yourself :)

  • I've been trying to get to the bottom of this but I can't seem to get a concrete answer...

    I have noticed that the images you are using do not have dimensions that are powers of 2.

    How is this working?

  • @Kingtag1445 Yes that is true. It's certainly recommended that the images have dimension that are powers of 2, but it doesn't have to be that way. It knows to stretch images and things like that. But for the best results, use dimensions that are powers of 2.

see all

All Comments (40)

Sign In or Sign Up now to post a comment!
  • you give the best tutorials ever. Better than native english speakers! Thank you and keep up the amazing work!

  • @1chapper add "-mwindows" to the console command.

  • @RedReaper132

    I am running this in CodeBlocks in Windows and the problem is whenever I run the program, in addition to opening the game window it also opens an empty console window. How do i fix this?

  • I hope you can extend this to GPU programming :) such as OpenCL

  • Hi, thanks for doing the videos I really enjoyed them, but are you going to do any more? It's been 2 months.

  • Maybe make a level 2?

  • maybe a title screen if possible or a game over screen??

  • MORE PLEASE :D

  • @RedReaper132 I've watched and enjoyed all 10 episodes of this series, and I found them very helpful to get into SDL and OpenGL. Thank you! :-)

    In this 10th episode there is a small flaw though, when you change the direction of the ball based on which side of the pad it hits. The behavior you modeled is totally unphysical (assuming that your pad is still rigid) and looks weird. What you could do instead is change ball.vx depending on pad.vx when the ball hits the pad to model friction.

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more