Added: 11 months ago
From: wcake20
Views: 3,495
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (46)

Sign In or Sign Up now to post a comment!
  • can you please tell me from where you learnt allegro programming......... please do reply

  • @arpit772

    There are tutorials online. Easiest way is to read the Allegro 5 tutorials in the Allegro Wiki. You can refer to my other comments for more info.

  • Good work

  • Reminds me of geometry wars (my favourate arcade game.) Excellent work!

  • Nice job man o_o I have to make a C++ project and chose a game based on Allegro, would you recommend any online tutorial?

    Totally loved your game :O

  • @Dan1loBr

    I recommend the Allegro 5 tutorial in the allegro.cc wiki. It teaches you some of the basic functions and explains how allegro works. It helped me to get started with allegro.

  • @wcake20 I'm having a lot of trouble with it, it tells the basic allegro 5 functions, but I want to load bitmaps(images) for background and some objects, as well as draw numbers on the screen... THEN I will handle events, which is fairly comprehensible for me...

    I'm thinking about porting to allegro 4, would you recommend?

  • @Dan1loBr

    You can try the Allegro 5 Manual at allegro.cc / manual/5/ . Look for the functions al_load_bitmap and al_draw_bitmap under "Graphics" (make sure you read the display tutorial first). Drawing numbers is under "Font Addons".

  • @wcake20 Thank you!

    I've experimented Allegro 4 and found it WAY EASIER to "make things work", but as far as event tracking goes, Allegro 5 seems ~way~ superior. I think I'll stick to 5 since logic can be made a lot better, thanks for the tips ;)

  • Totally insane, superb, ingenious STG dot

  • its great :D do you know how to limit fps in allegro ? i need it :D

  • @furfagns

    My draw functions are completely separate from my game functions (as in, any function that draws images to the screen has absolutely no impact on in-game variables). I only run the draw function if a boolean variable redraw == true. Then I make it such that every 2 counts of the allegro timer (See tutorial), redraw will be set to true. By keeping drawing and other functions separate, you can easily control the frames drawn per second.

  • to you...

    what a really stupid game. Never seen something so bad

    By now you will have realized that i am speaking sarcastically and i can only hope you finish the game, fantasist graphics, obviously efficient coding, well done!!!!

  • @TheOneToxic

    Well, it's actually finished (although what is displayed here is not the finished version). Or at least I no longer plan to work on this game any more. What's in the download link is the final version and I will be moving on to other games.

  • awsome work!

  • Wow that's amazing.

  • @theTrevorgoo

    Unfortanutely no.

    I usually play my own music (music from other games) when I play this game.

  • @wcake20 you said you wanted almost everything done by you. You should consider using mario paint composer to make some cool music.

  • @askmiller

    Could work, but unfortanutely, I have absolutely no talent in making music.

  • Wow, that is cool. How long did it take you to make? I just finished making pong using allegro 5. :P

  • @Neb1501

    I finished this about 2 months after I started learning allegro / C++.

  • what website did you learn to use allegro in?

  • @blackyurizan

    Google "allegro 5 tutorial" - I used the allegro wiki tutorial.

    It was pretty useful in helping me get started.

    After that, it was just a matter of googling what I didn't know.

    Also, google "allegro 5 reference manual" - it is a very good reference for the API.

  • This is really cool! Keep it up :] I really like the power ups.

  • Wow!! Nice work!! :D

  • I always wanted to know how to do 2 of the things you did:

    1: rotate the sprite according to the mouse position and

    2: pixel collision

  • @djsotos Not that I know how to do all the other stuff, like AI, animation etc. but whatever :P

  • @djsotos

    1: rotate the sprite according to mouse position.

    First, I made a function(xi, yi, xf, yf) which takes two points and returns the bearing (angle) from the first point to the second point (using the trigonometric functions from math.h). You have to make sure that the function also returns the angle in the correct quadrant.

    Use that function to calculate the bearing from the position of the ship to the absolute position of the mouse every frame, then draw a rotated bitmap of the ship.

  • @djsotos

    2. pixel collision

    I did not use pixel collision for this game (I think it would cause too much lag to check collision for each pixel). Instead, I created formulas to detect collision between shapes. I had 2 formulas - one to detect collision between 2 circles (Just check if the distance between the centres is smaller than the sum of their radii), and one to detect collision between a circle and a polygon (the polygons are defined by a set of polar coordinates in anticlockwise order).

  • @djsotos

    Also, since the polygon&circle collision formula is quite complicated, it would cause lag if there were a large number of polygon (including rectangles) bullets in the field at once (because you have to check collision every frame)

    Thus, before I apply the collision check formula, I do a much simpler initial check for each object to check whether the object is close enough to bother with the more complicated formula (by giving each object a bounding box slightly larger than the object).

  • Very impressive. Are you going to put up the source sometime? :D

  • @sorajsm

    I'm not sure if I should be releasing the source code to public. If you want to know anything about how this game is made, just ask away. It'd be much easier than looking through 600,000 characters of code to figure it out. However, maybe, in future, I could release a source with just the base coding for the game, without the levels coded in (except maybe an example level) for people to mess around with.

  • @wcake20 okay, I have a question for you: How did you get a sprite for the cursor? Could you possibly msg me the code or tell me what function you called? Thanks!

  • @sorajsm

    Since Allegro can detect the position of the mouse on the screen, you can just draw the bitmap of the cursor at the position of the mouse every frame. However, the cursor in my game is not a bitmap. I drew it using allegro primitives. I created a function called sprite_cursor(float x, float y), which draws all the primitives for the cursor relative to the position (x,y). Then, I ran this function every frame with the position of the mouse as x and y.

  • @wcake20 Ok, thanks! How did you get the asteroid background to move? (Closest moves fastest, farthest moves slowest)

  • @sorajsm

    Each background is split into layers.For the asteroid background, I have the foreground rocks layer, the background rocks layer, and the space/stars layer.

    The foremost layer is the most easily drawn. It is drawn the same way as how enemy sprites are drawn. An enemy sprite is drawn by calculating the position of the enemy relative to the screen's position, then drawing it there. The foremost layer bitmap can be imagined to be an enemy sprite that remains at the aboslute position (0,0).

  • @sorjasm

    For the other layers, a similar approach is taken, but after you calculate the position of the bitmap relative to the screen's position, you divide that displacement vector by something (e.g. 2), to make it move slower (e.g. twice as slow). This is just the general idea. The actual coding process would take some mathematical skill to get it right.

  • This game isn't bad!If you know how to code in C++ and DirectX we can get contact and you can code in our company.If you are interested write ma a private message.

  • If anyone wants, I can explain how I did certain aspects of this game. Things like how I programmed the enemies and their paths, how I made bullets, collision detection, scrolling backgrounds, layered backgrounds, the piercing round / time warp, the minimap, the enemy indicators (red triangles), etc...

  • @wcake20

    Yes, actually! I think that would be helpful. For me, I would like to know how you did the minimap. I like the crisp graphics you have in the game, and I'm impressed by the gameplay.

  • @VeradoonKing

    Making the minimap is pretty simple actually. While sprites in playing field (e.g. enemies, bullets) are drawn relative to the player's position, for the minimap, a circle is instead drawn based on the absolute position of the enemy/player. The size of the playing field is 1200x1200 pixels, and the size of the minimap is 200x200 pixels, so I take the coordinates of the absolute position of the enemy and multiply by (200/1200) to get its position on the minimap.

  • The graphics are clean and fun! I really like all the weapon effects. Nice job!

  • Very Impressive!

  • That's awesome! Well done!

  • is just great! i'm doing just like you... starting to learn but maybe ending up doing a little game. If you plan to dedicate to this labor i hope you make it sucessfully! keep it up!

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