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 / Pacman Game Help

Author
Message
Metroid Larvae
16
Years of Service
User Offline
Joined: 17th Oct 2008
Location:
Posted: 17th Oct 2008 22:52
I am trying to display my maze to sceen by using the GetImage() function and when I use it nothing displays on my screen. I will display the code in separate posts.

Attachments

Login to view attachments
Metroid Larvae
16
Years of Service
User Offline
Joined: 17th Oct 2008
Location:
Posted: 17th Oct 2008 23:12 Edited at: 17th Oct 2008 23:39
This is Main.cpp:
----------------------------------------------------------------

Metroid Larvae
16
Years of Service
User Offline
Joined: 17th Oct 2008
Location:
Posted: 17th Oct 2008 23:13 Edited at: 17th Oct 2008 23:39
This is Pacman.h
-------------------------------------------------------------
Metroid Larvae
16
Years of Service
User Offline
Joined: 17th Oct 2008
Location:
Posted: 17th Oct 2008 23:14 Edited at: 17th Oct 2008 23:39
This is Sprites.h
--------------------------------------------------------------
Metroid Larvae
16
Years of Service
User Offline
Joined: 17th Oct 2008
Location:
Posted: 17th Oct 2008 23:14 Edited at: 17th Oct 2008 23:40
This is Maze.h
--------------------------------------------------------------
Metroid Larvae
16
Years of Service
User Offline
Joined: 17th Oct 2008
Location:
Posted: 17th Oct 2008 23:27
Here is the maze picture I am trying to get the tile image from.

Attachments

Login to view attachments
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 17th Oct 2008 23:58
Standard question:

Did you do a check for the existence of the image file? You really need to understand where the program expects to find the file. For text purposes use a fully qualified path to the file. If that works then you can work on the logistics of where it really needs to be located later.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
Metroid Larvae
16
Years of Service
User Offline
Joined: 17th Oct 2008
Location:
Posted: 18th Oct 2008 02:56
Yes, I know which folder the image is supposed to go in. I got my Pac-man sprite to write to the screen, I just can't get PasteImage() to do anything.
Metroid Larvae
16
Years of Service
User Offline
Joined: 17th Oct 2008
Location:
Posted: 18th Oct 2008 05:05
So, I tried to get just a tile from the maze image and for some reason I can't even see the Pacman on the screen. This is what I tried to use:

dbLoadBitmap("Maze.png", 7);
dbGetImage ( 8, 0, 0, 31, 31 );
dbSprite (8, 0, 0, 8 );

Is this the correct way to use the functions? I really don't understand how the GetImage() even works and how am I supposed to draw the image that I got to the screen.
AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 18th Oct 2008 18:40
Try using dbLoadImage() instead.

Quote: "I really don't understand how the GetImage() even works"


GetImage() will create in image out of the specified section of the screen. Pretty simple once you understand what it does.

Metroid Larvae
16
Years of Service
User Offline
Joined: 17th Oct 2008
Location:
Posted: 18th Oct 2008 20:26
It's still not working... even with the refined code

dbLoadImage("Maze.png", 7);
dbGetImage ( 8, 0, 0, 31, 31 );
dbSprite (8, 0, 0, 8 );

Am I using the image Ids wrong or something, because I can get the whole image to display if I get rid of GetImage() and change the last parameter of dbSprite to 7.
Metroid Larvae
16
Years of Service
User Offline
Joined: 17th Oct 2008
Location:
Posted: 21st Oct 2008 21:06
I can't get anything to work. Can someone just explain to me step by step how to use GetImage() to get a tile from my maze picture file and put in on the screen at a certain location. Thanks.

Login to post a reply

Server time is: 2024-11-25 06:49:48
Your offset time is: 2024-11-25 06:49:48