Allegro is a cross-platform, open source, game programming library, primarily for C and C++ developers.

learn more… | top users | synonyms

0
votes
1answer
33 views

Events aren't working (Allegro5)

I've been using allegro for some time, and the timer event worked in all my previous projects, but I don't know what happened this time, I want to move a piece as long as the game is going, but it isn'...
1
vote
1answer
125 views

Collision isn't working in pong

I've posted about another pong problem a while ago, but now I'm having another problem with the ball collision with the paddle , when the ball collides, it doesn't bounce back, why is that? Here is a ...
3
votes
2answers
121 views

How can I make the ball in pong move even if no event is taking place in Allegro5?

I've been trying to make a pong game with C++ and allegro5, I found moving the ball around easy with SFML, but in allegro5 I don't know what I can do to move it around, right now, it moves but only ...
0
votes
1answer
42 views

Is there a 'wait' function in Allegro5?

I am creating a game in allegro5 and I have come across a problem. I have a character that fires a shotgun and there needs to be a delay before he can shoot again. The code for shooting his gun is in ...
1
vote
2answers
96 views

Allegro: slow drawing lots of images in 2d sandbox

I want to know if there is any better way to do this. But i want to make a game where its 2d and made of blocks. But a test that draws blocks to the screen and its going so slow that its not even ...
0
votes
0answers
63 views

RakNet & Allegro Client/Server Program Lagging?

I have a simple RakNet program that I wrote up with Allegro, and when I run the program and connect the Clients to the Server, they program starts to lag and uses up practically all of my CPU. I don'...
0
votes
1answer
215 views

Can i use shaders in allegro without opengl?

I'm currently learning opengl but it seems quite complicated so i considered using some library like sdl or allegro. I noticed that allegro has some built in functions to create and attach shaders. ...
1
vote
2answers
396 views

What's the most efficient way to deal with in-game messages in Allegro 5?

I have a little 2D game made with Allegro, and I want to introduce strings during gameplay. For example, I've just made it so a key is needed to open a door, so I'd need some tutorial text to appear ...
1
vote
1answer
264 views

Draw a rotated rectfill in Allegro 4.2?

I'd like to use Matricies to transform primitive geometric shapes and draw them using the Allegro library using version 4.2 (I can not switch to 5.x just yet). This works fine for non-filled objects ...
1
vote
1answer
753 views

How write pixel by pixel with a fast way Allegro 5.01

I'm currently trying to do a black and white filter for my game in c++ with Allegro 5.01, I'm doing like this. void GameEngine::blackAndWhite() { ALLEGRO_BITMAP *buffer = al_get_backbuffer(...
29
votes
6answers
9k views

How to solve the big video memory requirements in 2d game

We are developing 2d game (Factorio) in allegro C/C++ and we are facing the problem with increasing video memory requirements as the game content increases. What we currently do is, that we gather ...
1
vote
1answer
110 views

Why does rendering a gradiented shape leave gaps?

Sometimes when I am drawing objects that aren't 'linear' (e.g. rounded edges, circles, ellipses, diagonal lines, etc) I this weird effect of some pixels at certain points not getting drawn. It's ...
2
votes
2answers
644 views

Collision detection - make sure the player touches the object exactly

I know this is really something I should be able to figure out on my own, but a solution is evading me. Okay, here are a few relevant parts of my code. bool Game::Col(int x1,int y1,int w1,int h1, ...
0
votes
2answers
1k views

What do I need to implement a side-scrolling screen, like in classic platformer games?

I'm working on a game in Allegro for C++. I'm stumped about how to scroll the screen. I'm trying to make the screen scroll with the player, as it does in classic side-scroller games such as Super ...
2
votes
2answers
246 views

Should I create generic bitmap/sound/et cetera wrappers for Allegro?

Basically, I have been writing a game in C++ using Allegro. I mostly just use the library to draw bitmaps, draw text, and play audio. My main concern as the game continues to grow code-wise, is that ...
1
vote
2answers
285 views

Large-Scale 2D worlds with a “world texture” to draw to causing memory issues

Background: I've currently implemented a world class where the dimensions are provided in meters and those dimensions are translated to pixel values for an allegro (4.x) memory bitmap to be created ...
1
vote
2answers
590 views

Smooth animation when using fixed time step

I'm trying to implement the game loop where the physics is independent from rendering but my animation isn't as smooth as I would like it to be and it seems to periodically jump. Here is my code: // ...
0
votes
1answer
648 views

Removing drawn Allegro texts and primitives

I'm working on a game with Allegro 5 that has a loop. I'd like to make the program write onto the screen, how much time the loop has ended. These are the rounds of a turn-based game, obviously. I use ...
0
votes
1answer
312 views

Linking error when compiling Allegro example [closed]

I am currently learning about game development tools and decided to use Allegro and OpenGL for starters. I've run into some problems in getting examples to compile though. It seems the allergro.h ...
-1
votes
3answers
888 views

How can I have multiple layers in my map array?

How do I load Levels in my game, as in Layer 1 would be Objects, Layer 2 would be Characters and so on. I only need 3 layers, and they will all be put on top of each other. i.e having a flower with a ...
2
votes
1answer
1k views

Allegro 5 al_draw_text skips characters

I'm using Allegro 5.0.8 al_draw_text to draw text on a bitmap (backbuffer). However, I've noticed that the first character of the string is always skipped. Moreover, whenever the same character ...
0
votes
1answer
595 views

Allegro 5 compiling with GCC on mac [closed]

I have the following code from a tutorial and i am trying to compile it on a mac using g++/gcc however every time it complains about the native dialog but i am referencing the library correctly i ...
0
votes
3answers
626 views

Problem with alleg42.dll / program crashes / Allegro & Codeblocks

I'm having a serious problem with allegro. The program should display random pixels on the screen and when I build and run it I get the following error message: Below is the full code of my program: ...
2
votes
2answers
2k views

How to slow down a sprite that updates every frame?

I am going through a Allegro 5 tutorial which has a game loop. There is also a variable "active" which determines if a key is being held down. Thus if the left key is being held down active is on and ...
1
vote
2answers
581 views

Full screen blackout using allegro in codeblocks

I'm very interested in game programming and I'm taking my first steps alone. So I installed allegro. Although Dev-C++ didn't work, Code::Blocks compiled successfully. I started out with this basic ...
0
votes
1answer
3k views

“LNK2001: unresolved external symbol” when trying to build my program

I get the following error(s) on my program that captures the mouse and then draws a line. Errors: 1>------ Build started: Project: Capture_Mouse_Line, Configuration: Debug Win32 ------ 1> main....
3
votes
1answer
2k views

Why is the framerate (fps) capped at 60?

ISSUE I recently moved a project from my laptop to my desktop(machine info below). On my laptop the exact same code displays the fps(and ms/f) correctly. On my desktop it does not. What I mean by ...
2
votes
1answer
999 views

Space invaders clone not moving properly

I'm trying to make a basic space invaders clone in allegro 5, I've got my game set up, basic events and such, here is the code: #include <allegro5/allegro.h> #include <allegro5/...
2
votes
0answers
313 views

Full screen shader causes performance hit

I basically want to have a shader run that can do something like toon shading, or grayscale the whole screen, or radial lighting. To do this, I create a new bitmap each time the display resizes that ...
1
vote
2answers
2k views

Dealing with keyboard input

In game design how should keyboard input be handled and why? Do i A: check the state of keys in the main loop each iteration? B: Read key down and key up events from the event queue. Im using ...
4
votes
3answers
840 views

Current library situation [closed]

Allright so I've been doing some searches, here what I got: SDL: It is a standard, very mature but very old. (I got posts of late 2009 where they were still waiting for the 1.3 to come up...we are ...
11
votes
1answer
2k views

How can I draw an arrow at the edge of the screen pointing to an object that is off screen?

I am wishing to do what is described in this topic: http://www.allegro.cc/forums/print-thread/283220 I have attempted a variety of the methods mentioned here. First I tried to use the method ...
-2
votes
2answers
885 views

OpenGL + Allegro. Moving from software drawing X Y to openGL is confusing

Having a fair bit of trouble. I'm used to Allegro and drawing sprites on a bitmap buffer at X Y coords. Now I've started a test project with OpenGL and its weird. Basically, as far as I know, theirs ...
0
votes
1answer
771 views

Allegro Game Won't Fire 2D Projectile

To begin with I am developing a PSP application so I have no clue how to debug a PSP application. That doesn't mean I do not know how debug period. Anyway, when I run the game everything runs fine but ...
2
votes
1answer
945 views

Allegro 5 Mouse Look

I found good tutorial on how to do mouse look for 2D game here: http://www.atburrow.com/2010/03/08/objects-facing-the-cursor/ My code looks like this: w = (double)mouse_x - (double)pos_x; h = (...
-1
votes
1answer
4k views

What is the best engine for my first serious 2d game? [closed]

What game engine/graphics engine should I use for my first indie game? I'd like to add that this is not my first game, I've previously used Allegro for 2d development (pong, chess and stuff). I am ...
2
votes
1answer
458 views

How to refresh allegro textprintf_centre_ex text upon keypress?

I'm trying to print the coordinates of a drawn square upon movement. The problem is that the x value doesn't get refreshed on screen. This is the code I have: #include <allegro.h> BITMAP *...