Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » Installation as library for another engine?

This thread is locked; no one can reply to it. rss feed Print
Installation as library for another engine?
neyirK
Member #15,578
April 2014

Hi all

I'm a computer engineering student with almost no knowledge in game programming whatsoever... ???
But, our class was assigned a project to create a game using allegro or something similar that's due in less than a month. Yes, you read right, we have to create a game in 3 weeks, with no knowledge (except for the basic C++ we learnt in class this semester) and it can't be simple, according to our lecturer. Basically, flappy bird and frogger are out of the question.

So, while researching I stumbled upon Angel2D which is a game engine rather than a game library like Allegro. I tried using it but had trouble since there aren't many tutorials and the forum is sort of dead. Allegro seems easy to understand however I can't seem to get Box2D working properly (another prerequisite). Angel2D comes with Box2D and some other useful gadgets but I don't have enough time to understand all of it.

So my question is; How do I incorporate Allegro into Angel2D? I tried using the basic tutorial of inserting the required fields under properties (linker, and C/C++) but Visual Studio throws LNK2019 errors everywhere :-/. Separately, Angel and Allegro work fine, but not together.

Alternatively, if someone can help me find my problem with Allegro and Box2D that would also be greatly appreciated :)

Sorry for the long-winded explanation :-X

Thanks in advance to all that help :)

Mark Oates
Member #1,146
March 2001
avatar

Do you need to use Angel2D? or can you use just Allegro+Box2D?

To me, incorporating Allegro and Box2D without any experience in game programming, and making a "complex" game in 3 weeks seems a bit unreasonable - but possible.

So 1) can you be a little more specific about what exactly constitutes "complex"? and 2) what degree of C++ experience do you have? What kinds of programs have you written so far?

--
Visit CLUBCATT.com for cat shirts, cat mugs, puzzles, art and more <-- coupon code ALLEGRO4LIFE at checkout and get $3 off any order of 3 or more items!

AllegroFlareAllegroFlare DocsAllegroFlare GitHub

LennyLen
Member #5,313
December 2004
avatar

neyirK said:

So my question is; How do I incorporate Allegro into Angel2D?

While it's probably possible to replace whatever Angel2D uses with Allegro, it certainly wouldn't be a simple task, so isn't really an option for you.

Quote:

Alternatively, if someone can help me find my problem with Allegro and Box2D that would also be greatly appreciated

We can't help you if you don't actually tell us what the problem is.

neyirK
Member #15,578
April 2014

Do you need to use Angel2D? or can you use just Allegro+Box2D?

Allegro + Box2D should be fine.

1) can you be a little more specific about what exactly constitutes "complex"?

1)
He specified that flappy bird, frogger, etc were too simple.
We were looking into either a simple tower defense or something of that nature.
We're not really certain due to the situation.

2) what degree of C++ experience do you have? What kinds of programs have you written so far?

2)
We've programmed in JAVA, C, and visual basic. We're pretty knowledgeable in the basics and maybe a bit of intermediate work. We've made calculators, converters, worked with structures, classes, and recently made tictac toe (but in the console not in a window). My group and I are the most adept in our class. People usually ask us for help and such. So our lecturer put a load on us and expects something "different" or just a little extra that most others aren't capable of. We are quick learners.

___________________________________________

LennyLen said:

We can't help you if you don't actually tell us what the problem is.

I tried building it myself and it didn't do what the tutorial said it would
Tutorial
I did, however, find a pre-built version for VS2012 (which works although I'm using VS2013)

So:
Where do I put Box2D in my allegro project?
How do I call it in my classes (as in what do I put in properties, not <box2d.h>)
and anything else you feel I should know?

Thanks
neyirK

LennyLen
Member #5,313
December 2004
avatar

neyirK said:

Where do I put Box2D in my allegro project?

What are you actually trying to ask here? Is it where do you put the files for box2d? Or how does box2d fit in with Allegro?

For the first question, box2d is just like any library, so you install it and then just include it in your code.

As to where it fits in with Allegro, that's a bit trickier as the two libraries are designed to do completely different things. You use box2d to model real life physical objects and calculate their interactions. Then once you have calculated these you need to convert the real world units that box2d uses (metres) into units that Allegro can use (pixels).

Quote:

How do I call it in my classes (as in what do I put in properties, not <box2d.h>)

Considering that we have no idea at all what you're trying to model, we don't know what parts of box2d you need and so we can't answer this. So far you've suggested you might do a tower defense game. However I can't see any use for box2d in such a game, unless you want to construct towers out of multiple components and simulate how they would come apart when hit.

Quote:

and anything else you feel I should know?

Without trying to sound offensive, I think there's probably way more that you need to know than you have time to learn. From the questions you've asked and the level of proficiency you've shown here, the task at hand seems beyond your abilities for such a short time scale.

neyirK
Member #15,578
April 2014

LennyLen said:

What are you actually trying to ask here? Is it where do you put the files for box2d? Or how does box2d fit in with Allegro?

Both. See, I haven't built the files myself. I have pre-built files and don't know what to do with them to incorporate in my allegro project.
See attachment :
{"name":"608472","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/a\/2aebc5ac341e0550b8c083d110502672.jpg","w":1366,"h":768,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/a\/2aebc5ac341e0550b8c083d110502672"}608472

I have tried opening the pre-built solution then adding my project to it so that I can call the files (<box2D.h>) but that doesn't seem to be working. So what do I put into:

  1. Linker - General (i.e : C:\allegro\include)

  2. C/C++ - General (i.e : monolith.lib)

  3. Linker - Input (i.e : C:\allegro\lib)

I currently have the Box2D.h file and the collisions folder etc in the C: drive alongside allegro. Allegro loads fine, but the Box2D.h file isn't funtioning properly when I try putting values into the aforementioned list.

LennyLen
Member #5,313
December 2004
avatar

You shouldn't be putting the box2d stuff inside the project you're working on. They need to be moved to wherever Visual Studio expects it's library files to be (I can't help you there as I don't use it).

Try installing box2d properly instead of using somebody else's version. You still haven't said what went wrong when you already tried, just that it didn't do what it was supposed to.

neyirK
Member #15,578
April 2014

I figured out the Box2D problem. I wasn't building it properly (Noob moment). There were two folders both named Box2D and I selected the wrong one for the build. That's functioning now and I've got the engines/libraries running. Thanks for the help =)

With reference to my first question though. Is there anyone who can tell me how to collaborate Allegro and Angel2D?

Go to: