Beginner's Guide to Game Programming Ep1 Part 4-A Graphics in Allegro 4
Uploader Comments (LusikkaMage)
All Comments (65)
-
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...
Allegro doesn't recognize bitmaps loaded with a function-_- any help with this?
DemangoProductions 5 months ago
@DemangoProductions What's the function's return type?
LusikkaMage 5 months ago
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 6 months ago
@440DECA Are you using masked_blit?
LusikkaMage 6 months ago
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 6 months ago
@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.
LusikkaMage 6 months ago