Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Beginner's Guide to Game Programming Ep1 Part 3-B Keyboard Input in SDL

Loading...

Sign in or sign up now!
10,600
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Jul 10, 2009

The Beginner's Guide to Game Programming:
A Problem Solving Approach
Episode 1: Makin' Pickin' Sticks
Part 3-B: Keyboard Input with SDL

This is a written and video tutorial created to teach the basics of Allegro and SDL as well as game programming in general, while encouraging the newbie to code it out themselves.

*EDIT*
Sorry, I messed up the first version of this video, so I removed it and made a new one, which is this one. If you're using the code from the original video, using SDL_Event, please watch this video and change your code.

This video talks about the functions for getting keyboard input, and a few other notes.

You can get the written version and other things at my site:
http://www.moosader.com

Playlist link:
http://www.youtube.com/view_play_list?p=B9C8BC6F495BD17E

  • likes, 0 dislikes

Link to this comment:

Share to:

Uploader Comments (LusikkaMage)

  • Rachel, you should search for a job in my school honestly spoken, so all of us could learn this! :D

  • @Zilva86 If you're going to college, I'd have to get a masters to teach. D:

    I might sooner or later.

  • Rachel, you should write a book! These tutorials are great!

  • Lulz. Where there is a pdf version on the site that's 38 pages long (though I need to finish it). @_@

  • hmm, just a quick doubt .. i am new to SDL yet,

    but, shouldn't you call the SDL_PumpEvents() function before calling SDL_GetKeyState() ?

    as i said i am new to SDL, i just brought a book about SDL (Focus on SDL) and i was reading the event handling chapter a few days ago, and i read that.

  • I think that might be if you're using the events.keysym.whatever stuffs, instead of actual key states (the integer), but I'll check on it when I get home.

    If it helps at all, I don't see it being used in LazyFoo's input stuff.

Top Comments

  • I don't play my games, I watch them!

see all

All Comments (25)

Sign In or Sign Up now to post a comment!
  • wonderful tutorials . very professional

  • @steff385 C++ is a language. DevC++, Visual Studio, and Code::Blocks are all IDEs and have no affect on the language itself (in general); it doesn't matter what you decide to use.

  • Can i use Dev-C++? Answer quickly please.

  • When you said "You want to play your games, not watch them. Heres how you do it:" My video crashed :(

  • @LusikkaMage only 38 pages!! Man! I have to read this 800 page java book in 3D gameing,good luck to both of us, nvm you posted this 1 year ago . . . .

  • whats the code to make the player move , how do i change the x,y cordinates of this image SDL_BlitSurface(image,NULL,scr­een,NULL);

  • TY so much for the key array info. So helpful.

  • Beginner's Guide To Game Programming: A Problem Solving Approach: The Pocket Guide

    ^Title xD^

    A little side note... have you noticed that pocket references hardly ever fit in pockets? Why the hell call them a pocket reference if they aren't for your pocket...

Loading...

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