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 / My abomination of a mapmaker

Author
Message
ErDa
16
Years of Service
User Offline
Joined: 17th Feb 2008
Location:
Posted: 21st Dec 2009 00:40
Good evening ladies and gents. I've been wanting to start, and hopefully some time complete, a small game for the sake of learning how to organize/document a coding project. However I'm for some reason stuck on the actual functionallity of the project, and to be honest this coding style is pretty confusing for me as I'm used to just mashing everything together in a big pile of global variables... It sounds weird but I've never wrote any big programs, so I've never really had a need to organize things.

Either way, my two problems:
1 - The very top left tile, which should be tile ID 5000, gives changes my cursor to image ID 1999, a 1x1 white dot.

2 - Map tiles won't change at all when I select a sprite and try to drawn onto the map grid.

I've tried stepping through it, and checked and doublechecked everything I can think of, but knowing myself I've probably just missed something very small/stupid, so I come to you guys with a desperate cry of help.

In chase you take the time to look through it, and manage to find out what's wrong, please post something about your approach to taking someone elses project and running through it to find out what the problem is.

Also any comments on the documentation (comments, heh) will be greatly appreciated!

Attachments

Login to view attachments
ErDa
16
Years of Service
User Offline
Joined: 17th Feb 2008
Location:
Posted: 24th Dec 2009 06:13
Anyone mind chiming in on why they aren't interested in helping?
Freedom Fighters
14
Years of Service
User Offline
Joined: 2nd Nov 2009
Location:
Posted: 24th Dec 2009 06:59
im looking at it. but i might be a while. but im looking through it.

Problem Solution That Never Fails: "Build A Bridge And Get Over It"
Freedom Fighters
14
Years of Service
User Offline
Joined: 2nd Nov 2009
Location:
Posted: 24th Dec 2009 08:38 Edited at: 24th Dec 2009 08:38
ok, its fixed. i found the small problem. sad know one else helped


ok.
heres the info
In File: MouseClick.cpp
In Function: void CheckMouseClick()
Change This Line: MousePointerSprite = i; -> (To) MousePointerSprite = i-1999;

In File: DrawToMouse.cpp
In Function: DrawToMouse()
Change This Line: dbSprite(1, dbMouseX()-16, dbMouseY()-16, MousePointerSprite); -> (To)
dbSprite(1, dbMouseX()-16, dbMouseY()-16, MousePointerSprite+1999);

That should make it work.

Problem Solution That Never Fails: "Build A Bridge And Get Over It"
ErDa
16
Years of Service
User Offline
Joined: 17th Feb 2008
Location:
Posted: 24th Dec 2009 09:50
Awesome, thanks alot for the help, it now draws. However I am still getting some sort of weird behaviour when I try to draw to the top left square. For some reason MouseCollision returns true every time, claiming that all sprites have an x/y of -1/-1.
Freedom Fighters
14
Years of Service
User Offline
Joined: 2nd Nov 2009
Location:
Posted: 24th Dec 2009 11:30
hmm, ill look into that for you.

Problem Solution That Never Fails: "Build A Bridge And Get Over It"
ErDa
16
Years of Service
User Offline
Joined: 17th Feb 2008
Location:
Posted: 26th Dec 2009 15:02
This is going to be completely unrelated, but I wouldn't wanna start a new topic. I used to have a function I wrote that would create a sprite off of any text input. I can't quite get it to work again after I lost it to a reformat. Could anyone throw me a hand? Thanks for all the help so far by the way!

I believe it went something like this:
Freedom Fighters
14
Years of Service
User Offline
Joined: 2nd Nov 2009
Location:
Posted: 26th Dec 2009 22:27
hmm, i've never seen something like that function. im unfamiliar in the that type of area. you'll have to ask someone else.

Problem Solution That Never Fails: "Build A Bridge And Get Over It"
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 27th Dec 2009 01:31
dbGetImage is what you're looking for. Also, you need to dbSetBitmap().

ErDa
16
Years of Service
User Offline
Joined: 17th Feb 2008
Location:
Posted: 27th Dec 2009 04:31 Edited at: 27th Dec 2009 18:33
Thanks a ton again! New and improved:



It works like a charm, however it needs a uni-color font or else the text will look funky, and have "traces" of the previous background. Also I had to paint the bitmap red because the default was black, so was the text.

Still unable to figure out the problem I posted above, though.

Login to post a reply

Server time is: 2024-10-05 21:10:43
Your offset time is: 2024-10-05 21:10:43