A little help for the Platforming Competition


Kordman916

Still Fresh
Joined
Jul 6, 2010
Messages
72
Hey everyone,


So earlier today I was browsing around the interwebs when I came across this little gem...


JNRDEV Platforming Tutorials (SDL)


It's a guide on making a platform game using SDL and it comes with source code and everything.


It comes with examples on how deal with:


Tile based Collision


Slopes/Hills


Screen Scrolling


Object management


Hopefully this gets more people motivated to Join the Platforming Competition and get some more games on the Pandora.


I have found one problem though: It says that it runs on all OSes that support SDL including linux but I haven't been able to get it to work here on Ubuntu 10.10 :(


So if anyone can get the examples to work in linux just post it here or PM me so I can repost it.


Edit: BTW the examples are at the bottom of each tutorial.


But anyway there you go enjoy!
 
Last edited by a moderator:
personally i'd recommend against using this as a starting point, from a quick glance it's not very readable, apart from the basic theory being pretty sound


but hey, each to their own i guess


if all it depends on is sdl, then it should compile pretty happily, then again it might have the line '#include windows.h' somewhere :D
 
Has anyone attempted to get any of the examples to work in linux?


If you've gotten one working post here on what libraries and dependencies you used.
 
I used to know the guy behind 72dpiarmy.com (before he committed suicide, grr..) and I'm pretty sad he's not around to see this platformer competition come into existence .. He was working on an amazing platformer game before he left the world (puit) and I have some of his sources for this project around, maybe I should dig it out and try to complete something in time for the competition ..
 
I used to know the guy behind 72dpiarmy.com (before he committed suicide, grr..) and I'm pretty sad he's not around to see this platformer competition come into existence .. He was working on an amazing platformer game before he left the world (puit) and I have some of his sources for this project around, maybe I should dig it out and try to complete something in time for the competition ..

I think he'd certainly appreciate that.
 
I'm sorry to hear about your friend :( Based on his code he seemed like an amazing programmer and he even programmed Super Mario War a game I played regularly in the past on my Dreamcast.


Now back to the original question:


Has anyone gotten any of the tutorial examples to run?
 
^I'd like to apologize beforehand if I incorrectly assume that you have no experience with SDL. I got the program to compile in Windows (I'm not in front of a Linux system ATM). I'm assuming you got a wall of text when you tried to compile it. Did you get a line near the top that said something like "SDL.h not found"? I changed (on line 26)



Code:
#include <SDL.h>
to

Code:
#include "SDL/SDL.h"
. Also, make sure you're passing both .cpp files to the compiler. I imagine the command would look something like

Code:
g++ *.cpp -lSDL


If that doesn't work, I'm guessing your dev environment is incorrectly configured.
 
^I'd like to apologize beforehand if I incorrectly assume that you have no experience with SDL. I got the program to compile in Windows (I'm not in front of a Linux system ATM). I'm assuming you got a wall of text when you tried to compile it. Did you get a line near the top that said something like "SDL.h not found"? I changed (on line 26)



Code:
#include <SDL.h>
to

Code:
#include "SDL/SDL.h"
. Also, make sure you're passing both .cpp files to the compiler. I imagine the command would look something like

Code:
g++ *.cpp -lSDL



If that doesn't work, I'm guessing your dev environment is incorrectly configured.


I have all of the libraries setup I get these errors when trying to compile in Code::Blocks 10.05 with Ubuntu 10.10



Code:
/home/kordell/Downloads/jnrdev2example/jnrdev #2.o||In function `main':|

jnrdev #2.cpp|| undefined reference to `gfx_init(int, int, bool)'|

jnrdev #2.cpp|| undefined reference to `gfxSprite::init(char const*)'|

jnrdev #2.cpp|| undefined reference to `gfxSprite::init(char const*)'|

jnrdev #2.cpp|| undefined reference to `gfxSprite::init(char const*, unsigned char, unsigned char, unsigned char)'|

jnrdev #2.cpp|| undefined reference to `gfxSprite::init(char const*, unsigned char, unsigned char, unsigned char)'|

jnrdev #2.cpp|| undefined reference to `gfxSprite::init(char const*, unsigned char, unsigned char, unsigned char)'|

jnrdev #2.cpp|| undefined reference to `gfxSprite::init(char const*, unsigned char, unsigned char, unsigned char)'|

jnrdev #2.cpp|| undefined reference to `gfxSprite::init(char const*, unsigned char, unsigned char, unsigned char)'|

/home/kordell/Downloads/jnrdev2example/jnrdev #2.o:jnrdev #2.cpp|| more undefined references to `gfxSprite::init(char const*, unsigned char, unsigned char, unsigned char)' follow|

/home/kordell/Downloads/jnrdev2example/jnrdev #2.o||In function `main':|

jnrdev #2.cpp|| undefined reference to `gfxSprite::init(char const*)'|

jnrdev #2.cpp|| undefined reference to `gfxSprite::draw(int, int)'|

/home/kordell/Downloads/jnrdev2example/jnrdev #2.o||In function `CPlayer::draw()':|

jnrdev #2.cpp|| undefined reference to `gfxSprite::draw(int, int)'|

jnrdev #2.cpp|| undefined reference to `gfxSprite::draw(int, int)'|

/home/kordell/Downloads/jnrdev2example/jnrdev #2.o||In function `CMap::draw()':|

jnrdev #2.cpp|| undefined reference to `gfxSprite::draw(int, int)'|

/home/kordell/Downloads/jnrdev2example/jnrdev #2.o||In function `__tcf_0':|

jnrdev #2.cpp|| undefined reference to `gfxSprite::~gfxSprite()'|

/home/kordell/Downloads/jnrdev2example/jnrdev #2.o||In function `__tcf_1':|

jnrdev #2.cpp|| undefined reference to `gfxSprite::~gfxSprite()'|

/home/kordell/Downloads/jnrdev2example/jnrdev #2.o||In function `__static_initialization_and_destruction_0(int, int)':|

jnrdev #2.cpp|| undefined reference to `gfxSprite::gfxSprite()'|

jnrdev #2.cpp|| undefined reference to `gfxSprite::~gfxSprite()'|

jnrdev #2.cpp|| undefined reference to `gfxSprite::gfxSprite()'|

jnrdev #2.cpp|| undefined reference to `gfxSprite::~gfxSprite()'|

jnrdev #2.cpp|| undefined reference to `gfxSprite::gfxSprite()'|

jnrdev #2.cpp|| undefined reference to `gfxSprite::~gfxSprite()'|

||=== Build finished: 22 errors, 0 warnings ===|
 
Alright, what I think is going on is Code::Blocks is trying to compile the "jnrdev #2.cpp" file by itself. This is causing trouble because it references the glx.h header but the methods are implemented in gfx.cpp. I've never used Code::Blocks before, but if you figure out how to compile the two .cpp files together, I believe that should fix your problem.


Edit: Ok, the Code::Blocks manual says you need to make a project file if you have more than one source file. If you haven't done that already, then that would explain it.
 
Last edited by a moderator:
Back
Top