Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / C++ 2d array class background setup

Author
Message
icexcap
5
Years of Service
User Offline
Joined: 23rd Apr 2014
Location:
Posted: 28th Apr 2014 17:55
Hello everyone,

I am trying to use classes to display my 2d-background use a tiling technique. However, I tried the most simplest ways to produce my background but it all ended in failure. Can provide me with some assistance with this? I don't care if the whole code has to be rewritten I just it to get it up and running.

Here are the codes down below.

details: I created an single array of sprite-loaded objects with the "Sprite.h" class, then I created a 2d-array sprites and where they are going to be positioned. Next I created an object from the "Coordinate.h" class where it takes the width and height of each new sprite. The "Coordinate.h" then takes the width and height variables and uses a nested for-loop to produce the row and column numbers for the tileMap address which it should retrieve the sprite object withn the array tileMap. It should also produce the x and y position of each sprite.

However when I try it i get this error code:



Main.cpp


Sprite.h


Coordinate.h


I can do all things through Christ which strengthens me!
The Tall Man
5
Years of Service
User Offline
Joined: 16th Nov 2013
Location: Earth
Posted: 28th Apr 2014 20:12
Looks like the issue is in your project settings. Here's a similar post with a solution:

http://forums.codeblocks.org/index.php?topic=16421.0

If that doesn't work for you, find the library to link for those unresolved externals (__malloc_dbg, __free_dbg), and add it to your Additional Dependencies under Linker->Input in project settings.
icexcap
5
Years of Service
User Offline
Joined: 23rd Apr 2014
Location:
Posted: 30th Apr 2014 19:39 Edited at: 8th May 2014 06:36
The Compiler I'm using is Visual C++ 2008 Express Edition with Dark GDK. Can you tell me exactly how I should adjust my setting?

I can do all things through Christ which strengthens me!

Login to post a reply

Server time is: 2019-08-24 23:03:11
Your offset time is: 2019-08-24 23:03:11