Home > general, programming > How to install Box2D for BlitzMax

How to install Box2D for BlitzMax

Well, generally when a deadline is approaching I tend to lose focus from work πŸ˜€ . Well having one close deadline, today I remember to refresh my BlitzMax knowledge! BlitzMax is a 2D game development environment that I bought some years ago. If you are interested on 2D game programming you should check it out. When I was doing my research, I found it to be at the exact abstract level that I needed it to be, hiding enough details from the ‘boring stuff’ and at the same time having great flexibility.

At the same time I remembered a physics library a came across recently called Box2D. So naturally I searched about Box2D for BlitzMax πŸ™‚ After some time I was in a bit of trouble since I had to build the library myself through MaxIDE (default IDE environment for BlitzMax). I couldn’t find any straightforward directions in one place on how to do that, so I spend 1 hour before I was able to use Box2D in BlitzMax. So I will outline the directions here for you.

  • First of all you need to download the Box2D mod from maxmods. Find Box2D from the list and download it.
  • Then go into the mods folder of your BlitzMax directory. For me that is C:\BlitzMax\mod . In there you should already see a couple of directories. Create a new one and name it bah.mod . Enter that directory and in there copy the box2d.mod from the file you have downloaded. So now you should have the Box2D files in C:\BlitzMax\mod\bah.mod\box2d.mod
  • Then head over to MinGW and download it (sourceforge link).
  • Run the installer. Make sure you also choose to install g++.
  • After the installation is finished you should add the environment variables. Right-click on My Computer and choose Properties. Then go to advanced tab (see figure 1). Then add a new variable as you see in figure 2. After that you have to update the system variables. Search in the list and find the path variable. Edit it, go to the end of the line and add a semicolon(;) if there is not one already there and add C:\MinGW\Bin. Save everything and you are ready to go πŸ™‚
  • Open your MaxIDE and from the menu choose Programs > Build Modules (or Ctrl+D) and everything should work.
  • Now the Box2D is ready! You should be able to run the examples. If you have any questions let me know.
figure 1 - Box2D settings

figure 1 - Box2D settings

figure 2

figure 2 - Adding a new variable

References Β Box2D on BlitzMax and White Noise Blog

Related Posts:

Incoming search terms:

  • how to install box2d (36)
  • box2d install (13)
  1. leng46uk
    July 1st, 2010 at 12:14 | #1

    Great, thank you


  2. Paul Smith
    September 19th, 2011 at 17:41 | #2

    Hi, so, in these instructions when installing MinGW I assume you mean C++ not G++.

  3. psychoul
    September 20th, 2011 at 11:42 | #3

    No I mean G++ πŸ™‚
    The “gcc-g++” is for C++. See here http://www.mingw.org/wiki/InstallationHOWTOforMinGW

  4. Paul Smith
    September 20th, 2011 at 18:27 | #4

    I ve done that, still doesn t work πŸ™
    Do you have to have the latest version of blitzmax?
    mines 1.26. I think the latest is 1.32

  5. psychoul
    September 20th, 2011 at 23:17 | #5

    Hm. I worte this post in 2009. I am not quite sure what version was it. What kind of errors do you get?

  6. Paul Smith
    September 21st, 2011 at 19:19 | #6

    –can’t find interface for module “bah.box2d”–

  7. psychoul
    September 22nd, 2011 at 22:15 | #7
  1. No trackbacks yet.