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.

Newcomers DBPro Corner / Images won't appear on screen (DBP)

Author
Message
Platinum Dracula
19
Years of Service
User Offline
Joined: 4th Jul 2005
Location:
Posted: 11th Jul 2005 00:20


Not sure exactly what I'm doing wrong here, hoping you guys could help me out.

Since I'm on the subject of images and such, my program will require changing screens (or menus) when a mouse clicks a button. Would the mouseclick() function be what I'm looking for? Thanks in advance.
warship45
20
Years of Service
User Offline
Joined: 24th Jul 2004
Location: uk
Posted: 11th Jul 2005 00:59
well just by looking at your code what is not right is that you load the image then place it on the screen then the porgame will end. you need to put a wait 2000 or wait key at the end of your code or u will not be able to see the image as you progame will run and then end.

want to join a good dark basic forum then go to

http://www.phpbbplanet.com/forum/index.php?mforum=teamdarkstep
Platinum Dracula
19
Years of Service
User Offline
Joined: 4th Jul 2005
Location:
Posted: 11th Jul 2005 01:04


Updated it with your suggestion, still doesn't show though.
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 11th Jul 2005 05:04 Edited at: 11th Jul 2005 05:05
Ok, you need a loop to refresh the screen using the sync command. Try this:



Now the program will run and you'll see your image in the top left corner as you wanted (if the image exists).

<Edit> Im not sure if the paste image command needs to be outside or inside the loop. Try it as is and if it doesnt work then move the paste image part to just before the do command.


Current Projects: SHADE - Game Maker | Mecho - TGC Puzzle Entry | Halo Physics Engine | COLD - Polygonal Collision Detection
Platinum Dracula
19
Years of Service
User Offline
Joined: 4th Jul 2005
Location:
Posted: 11th Jul 2005 05:16
Awesome Thanks here is the code as is now (learned how to put my media in a project folder to keep from typing that long dribble)



Concerning sync, Everytime I use the Sync On command, Do I need to make a do,sync,loop type command as well? Perhaps Im gibbering but what i mean to say is, everytime I use sync on, do I need to put just sync somewhere down the line of code as well?

Thanks for your help
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 11th Jul 2005 11:11 Edited at: 11th Jul 2005 11:13
No not at all.

Here;s whats basically happeneing.

All games have a loop. A loop simply keeps on going and going. DO tells the loop where to begin, and LOOP tells it where to go back to the beginning.

The SYNC RATE is how many times the screen refreshes per second. So, without a DO/LOOP the screen will only refresh once. What you need to do is tell the system to keep refreshing as much as possible each second, we do that with a LOOP. Setting the SYNC RATE to 0 allows the computer to refresh as fast as possible, so its good to set it to 0.

Games usually only have 1 loop every, but with mini loops inside them.

Basically, whatever you want to be done all the time, put in a loop. Things like movement controls, variables that need to be updates, collision responses, etc.

But things you only want to happen once, put outside of the loop. Things like creating objects, loading media, and setting the game settings.

Hope that helps, goodluck.

<edit>, see the wait key command you have in there? That wont do anything because the loop keeps telling the program to loop. Put the waitkey in the program loop if you want it to wait for something. But just putting waitkey in the loop wont do anything, wait key basically stops everything from happening until any key is pressed, so you wouldn't want that in the program unless you need it.


Current Projects: SHADE - Game Maker | Mecho - TGC Puzzle Entry | Halo Physics Engine | COLD - Polygonal Collision Detection
Platinum Dracula
19
Years of Service
User Offline
Joined: 4th Jul 2005
Location:
Posted: 12th Jul 2005 06:43
Thanks man I understand what you're saying. But heres another question.

What if I want to add buttons that when my players click them, take them to different menus. Is there a way to return back to the main menu, say if they make a mistake? Also is it better to store data such as wrestler names, stats, promotions, etc in arrays or TYPES.

Im making a wrestling promotor sim (text) that's the reason I ask, thanks again.
Platinum Dracula
19
Years of Service
User Offline
Joined: 4th Jul 2005
Location:
Posted: 24th Jul 2005 02:55
bump

Login to post a reply

Server time is: 2024-09-23 23:18:11
Your offset time is: 2024-09-23 23:18:11