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

Beginner's Guide to Game Programming Ep1 Part 4-A Graphics in Allegro 4

Loading...

Sign in or sign up now!
11,848
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Jun 24, 2009

The Beginner's Guide to Game Programming:
A Problem Solving Approach
Episode 1: Makin' Pickin' Sticks
Part 4: Graphics in Allegro

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.

This video defines blitting, talks about sprite dimension standards, types of graphics, basic concepts, and how the code to load, draw, and destroy the graphics.

SDL version coming up next!

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, 1 dislikes

Link to this comment:

Share to:

Uploader Comments (LusikkaMage)

  • Allegro doesn't recognize bitmaps loaded with a function-_- any help with this?

  • @DemangoProductions What's the function's return type?

  • i put the background in my paint file as magenta(255,0,255) and it still appered with my sprite? how do i make just the sprite appear with no background?

  • @440DECA Are you using masked_blit?

  • You'll have to include the file path for the image file, correct? If so, how would I make it so I can import it on any computer? I don't want it to be C:\Users\Ryan\Desktop\Project\­Picture, I want it to be able to work on every computer. :|

  • @DrunkenWaffle Paths will automatically be in the folder containing the .exe, so if you have your "Game" folder with "game.exe" inside it, and a "Image" folder inside that place, then you just point it to the Image folder, and nothing else.

see all

All Comments (65)

Sign In or Sign Up now to post a comment!
  • Ok, last video, I was so confused, after a few tries I got the basics KINDA but after this video my mind exploded and now I get it. It all makes sense now O.o

  • @DemangoProductions Naw, I'm just trying to communicate a lot of information in a limited amount of space. YouTube comments aren't exactly made for programming discussion. :<

  • @CoderRach took me a while but i finally understand :) thanks ^,..,^ (I do however feel like i have made you mad *chuckle*)

  • @CoderRach (You'd have to write the LoadImages function yourself, that's not part of Allegro.)

  • @CoderRach But then you'd need to deal with pointers and references, and that's another thing you should be familiar if not comfortable with in C++ prior to starting with game programming in C++.

  • @DemangoProductions You can check out AntiRTFM for some C++ video tutorials on YouTube.

    You only need destroy_bitmap when your BITMAP goes out of scope, if this were scoped properly then you wouldn't want it at the end of this function, no.

    One thing you can do short of writing a whole manager structure is to declare the BITMAP in main before the game loop starts

    BITMAP* background, character, grass;

    and then call a function to set it

    LoadImages( background, character, grass );

    Cont.

  • @CoderRach yeah the 3 is that get's me... i haven't learned functions properly... where could I learn about them? about 1: how do i make it "touch"*giggle* the main? about 2: i have to destroy_bitmap at the end of every function?

  • @DemangoProductions Then you should STOP with Allegro, and go back and learn C++. Functions are one of the FIRST things you learn in C++, and if you don't understand them you shouldn't be writing games. AntiRTFM has some C++ video tutorials on YouTube.

  • @DemangoProductions Here are some things to take into account:

    (1) BITMAP* one is only in scope for the load_res function. It does not touch main at all.

    (2) You have a memory leak because, since the BITMAP is going out of scope at the end of the function, you're not freeing it.

    (3) I think you need to review your C++ basics; you do not seem to understand the concept of functions.

  • @CoderRach i don't really know what a function's return type is...

View all Comments »
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