Added: 2 years ago
From: Falciase
Views: 11,691
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (100)

Sign In or Sign Up now to post a comment!
  • This looks great, how did you ever make such a nice game only 2 months into C++?

  • MAN!!! actually the game seems pretty fun lol! so, have you ever used sdl? do you like allegro more than sdl?

  • nice game thats very impressive

    how long have you been learning c++?

  • @JakobRobert00

    At the point that I made this game, I was probably about two months in.

  • @Falciase wow thats amazing

  • Do you know how to program a level to automatically scroll? I know how to program it to scroll with the player...But I've been bashing my brain trying to figure out how to make it scroll automatically.

  • @adamrothraisdead

    Well, think about this then-- you have the camera's x value set at the player's x value minus half the screen width, right? So, instead of making the camera's x value dependent on the player's x value, make it an integer that automatically increments by, say, 1 pixel for every game loop. Then the camera would automatically scroll to the right.

  • @Falciase This is where I facepalm and wonder how I didn't figure that out myself. Thanks.

  • what libraries and file types did you use for the map handling? unless you hard coded each tile?

  • @TotalJargon

    Building the map was simply a matter of reading a two dimensional array of integer values. 0 stood for nothing, 1 stood for a solid block, 2 stood for a checkpoint, 3 for coin, 4 for badguy1, etc etc... I had a loadlevel function that had a loop that went through the level array, placing new objects for every nonzero value in the array at 32 pixel intervals. There were two loops nested in each other, one for the x values of the array, and one for the y values... Hope this helps!

  • arte!, esto es arte!

  • @Tortoiseius Muchas gracias, amigo!!

  • When I was recording this video, at 2:30 I quite literally facepalmed.

  • the game looks quite nice....can i download this in open source ?

  • can u teach me how to shoot multiple bullets ??

  • @noobgy One way you could go about shooting multiple bullets, is by using a linked list to store the bullet objects. Every time you fire a shot, you create a bullet object and add it to the linked list. When a shot hits, or a bullet is otherwise removed from the game, you remove that bullet from the list, and redirect the pointers (just like removing a typical node from a linkedlist).

    Not sure about the efficiency of this, but its the best i can come up with in 30 seconds xD

  • @noobgy I use a vector that dynamically adds a bullet object each time one is shot and dynamically removes it when it hits.

  • @Gigon12 go to my website on my channel's description and click on the 'old projects' section of the website to download!

  • are those sound effects from zelda a link to the past

  • @AndrewH1998 Yep! Read the description!

  • Could you please tel me how to code that multiple scrolling layers background. I'm trying to find one tutorial about this topic but i feel defeated, a can't find anything usefull. Can you help me please

  • hey man!, i'm studing programation but io can't wait to learn this from the teachers, can i see the program of this?, i want to do something similar one day!

  • Does allegro make sure the game is clocked at 30 FPS?

    For example, let's say you just kept setting an x-coordinate of an object to +1 every step of your loop, and then you simply draw him on the screen using allegro's draw/blit functions. How big of a chance will there be for the player to lag at certain times? Are there any optimisations you have to do with that x-coordinate to make sure it syncs with your 30 FPS? Or would you just do x+=1 and Allegro does all of that stuff for you?

  • @heymangone

    No, Allegro doesn't, not version 4.2 anyway (the version I was using; Haven't used it since then-- they are past version 5 now). But you have multiple options to limit the frame rate-- I used pthreads (an easy to implement timer system) to limit my game to 60fps and to prevent the computer from wasting cpu time waiting for a screen refresh :D Another option is to call vsync() before each draw to the screen-- however not everyone's monitor refresh rate is the same!

  • how did you implement the background and the camera?

  • @MrBlenderMan

    Camera is implemented by storing an x and y integer. These are the camera coordinates; At all times they focus on the player by getting the player's x and y and subtracting half of the screen width and screen height. Now, when you draw tiles, the player, and enemies, you need to draw everything relative to the camera-- when drawing, simply subtract from the sprite coordinates the camera x value and the camera y value from the respective coordinate x and y values.

  • @MrBlenderMan

    The parallax background is too difficult to explain on a youtube comment, sorry. To draw a stationary background, before drawing everything else, simply draw the background image to coordinate 0, 0 on the screen.

  • this looks fun good job!

  • @6am3r1

    Thanks!!

  • nice game :o

  • thumbs up if u think red guy is on crack

  • pretty cool game . How many years of experience do you have with c++?

  • @CodingMadeEasy Probably about 3 years!

  • @Falciase tru tru, well nice game anyways :D. I'm working on other projects right now but I'll be making a side scroller soon so I'll let you know when I start that. And who knows, maybe we can make a game together in the future, if you're willing to of course but yea it would be pretty nice to work with you :)

  • you are the fucking shit man !!!! Congrats !!

  • Allegro is awesome, it's simple and easy to use, yet very powerfull for 2d games.

  • are u killing mega man? lol

  • Where can I download this?

  • @davidgreen1020

    go to the website listed on my channel and click on the 'old projects' link to download it! youtube won't let me put the link to the website here.

  • How did you do collision on the x axis? I'm using a 2d array for my map and have successful y collision with whether or not gravity is affecting the sprite, but I don't know what to do if the sprite successfully collides on the side of my tiles.

  • @TheTntuser

    Well, when your character is moving left or right, before you actually move him (xLocation - xSpeed for moving left and xLocation + xSpeed for moving right) you first need to make sure that spot is actually unoccupied by a solid object! So before you move your character, for example when moving right, do something like this:

    if(noSolidObjectAtXY(xLocation + xSpeed, y)

    then(xLocation = xLocation + xSpeed)

    You just need to write a func. that checks if map is free at an X, Y location.

  • SO,so fkn cool. 15 years ago, this game would heve been a huge success:))

  • @Falciase

    To make your character jump, all you have to do is, for example, when you are pressing the spacebar key, SUBTRACT a constant jump force variable, like 4 from your character. This force will be greater than the gravity and propel your character upwards. Now, you just need to limit how long the player can hold down the spacebar key, so as to limit them from jumping infinitely high!

    Hope this helps.

  • @Falciase Thanks for such a quick reply! This is very helpful...i'll use some sort of timer function to do this... whatever works in darkGDK

  • Can you give me a basic idea of how you made your character jump? I have a problem doing this in my games.

  • @swagbucksmaster360

    Basic idea is this: at all times, gravity is pulling your character down, unless there is a solid obstacle beneath your hero's feet. If there is not a solid object beneath your character's feet, add a global gravity constant (for instance, .15) to your character's y speed. Do this every step that your character is in the air, until he hits solid ground again. This will be the constant gravity pulling on your character.

  • @swagbucksmaster360 if you want to have a jump function using only x and y variable just do it using a negative quadratic funcion and that will give you the motion

  • Thumbs up. 

  • looks fun, nice work, good level design.

  • Amazing job, love sound effects, sprites ,and gameplay looks quite fun! I never used allegro before always used SDL :P wish i were as good as u, u can check out my SDL games on my youtube channel but nothign too complicated like yours :P

  • This is a VERY cool game... bravo!

    Also it's a lot of nostalgia to hear all the Zelda sounds :D

    I am a professional programmer but so far games has not been on my resume, currently trying to find all the info I can about stuff like allegro, sdl, open gl, direct x, what they are, benefits and downsides, how to combine them, it's hard even for an experienced developer so once again bravo to you

  • You inspire me. just because of this video i went off and bought a book on allegro. awesome.do you mind if i use megaman sprites in my game too? i dont want to copy you :D

  • @MrDuskling

    hahah dude that's fine. in fact, if you go to my website (listed on my channel) you can download this game, and all the game graphics are in there. but yeah, megaman is awesome, you should use megaman sprites :D

  • You inspire me. just because of this video i went off and bought a book on allegro. awesome.

  • Just curious- I noticed that the "bullet" from the enemy disappears into thin air right when the enemy dies, regardless of it hitting you. Is this because you combined the alive status of the bullet with that of the enemy? Did you combine their bool values?

    thank you and great job! keep it up!

  • @tallthunder

    Yes, in retrospect, the way I handled bullets was terrible. I tied bullets to their owner, so when the owner no longer existed (bool alive = 0), neither did their bullet! Oh well. Won't make that mistake again :)

  • @Falciase

    Yeh I was making a pong game and I noticed that my ball would stop moving as soon as game was over (bool gameover = true). So I just moved the ball code out of the "if (bool gameover=true)" conditional statement and voila ball continues to bounce.

    Great job :)

  • How long have you been working on programming games?

  • @MrZekrot about two years now, if you don't count the stuff I made in GameMaker, hahah.

  • @Falciase Ok :P

  • @Falciase I don't count the stuff I made in Game Maker either.

  • Wow this is so awesome. :D

  • alot of zelda SFX :-/

  • @thowedthanka

    Who doesn't like Zelda SFX?? :P

  • @thevlogginggamer

    It's not just you, the guy that did the main character's graphics for me changed up Megaman's sprites from the NES games into a pirate, hahah.

  • @Falciase AWESOME!

  • Can you release the source code? Thanks

  • @sheepkilier

    Sorry, not anytime soon. Perhaps in a year or two, when I'm finished with my current project.

  • The game is awesome! I just think you should spread the invincibility power ups apart.

  • could you send me background sprites please? :)

  • @ison011

    Go to my website listed on my channel page and download the game and it has backgrounds in the gfx folder :)

  • @ison011

    Go to my website listed on my Youtube channel and download the game. It has background graphics in the 'gfx' folder :)

  • really cool game. How did u set up background? is it one huge bitmap?

  • @ison011 The background is two bitmaps that are each as large as the resolution of the game, 640x480. Each background is blitted 4 times to tile seamlessly and scrolled depending on the camera's x. Ultimately the only thing blitted is as big as the screen resolution, so no efficiency is lost.

  • good game man

  • really amazing work in just 4 weeks =]

    did you make a level editor ? =D or did you specify the level design from inside of the code? =]

  • Thanks for the complement! Check out my website to check out the new platforming game I'm working on :]

    I used mappy tilemap editor, which exports an array of numbers, which I can put into the game easily. I only made 3 levels, but they only take like 5-10 minutes to make :D

  • Nice man, how many files did it take to code this, also wondering, how did you set up the animation?

  • About 5 header files and 1 main file. Animation was set up by looping through a frame number to a max number every couple of steps. Depending on what the player was doing [jumping, walking, climbing up ladder, etc] it displayed the corresponding bitmap.

  • About how long of learning C++ did it take you to be able to make this game?

  • About half a year of messing around with Allegro. Before this game I made a text adventure, a 4 player warlords (similar to breakout) game, and a 3 player buster bros. game.

  • This is pretty cool! Im just starting with allegro (i've been trying to make C++ games for almost 4 months and just found out about allegro so im really happy =D). I was wondering how you designed the whole map, is it an extremely large image, or all designed in the coding? I just figure out how to design something like that...

  • You need to make a class of blocks, which is what I did. It is not one large image-- I've seen people do that, and it's terribly inefficient. Don't do that, as it is a terrible way to code a game. Make a class of obstacles, and then you just arrange the blocks how you want them in the level.

  • but did you do it in a matrix / 2d array? or did you do it some other way?

  • It is in a single dimensional array of numbers. The numbers signify what each spot should be, such as a block, an enemy, a powerup, or empty space.

  • @Falciase

    but that would only be one row in the game wouldn't it? how do you have multiple rows of stuff if its only a single dimensional array?

  • Hmm, you could do a 2d array, however I just use a one dimensional array and tell the thing when the next row begins-- ie, every 50 blocks (for a 50 block wide level). 2d array would probably be easier, honestly, but they both work!

  • I have a few questions. Why does the pirate shoot jelly beans and why are the enemies megaman when your on "dinosaur" island. But overall it's very nice.

  • Both the jelly beans and all of the enemies being Megaman-- that was all cause I didn't have any art to put there. This was a class project, and the artists that were supposed to design the art of my game provided nothing but the main character sprites-- so I just went on the internet and grabbed a few Megaman sprites for my enemies :P The jellybean thing-- I really just made it neon colors so as to demonstrate that it was, in fact, animated, rather than a still image for the bullet.

  • Also-- I took great care to make this game as efficient as I knew how to at the time I made it... as a result, this game runs very nicely with any PC with a 500mhz processor, and 10mb of RAM :P maybe even a slower processor could work, but I have yet to test it on a slower computer than that :P

  • Nice :) how you made map scrooling and its collision?

  • You is moving all object or just camera(but it is impossibile in allegro i think)

  • Objects stay in the same location, but when drawing the objects, draw them relative to a scroll_x and scroll_y variable. For anything that draws to the buffer, draw it to x-scroll_x and y-scroll_y and voila! Scrolling :D

  • the only thing i don't like is that when you kill an enemy his missles or weapons disapear right when you kill him

    but other then that good job, looks fun :D

  • Thanks! :D

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