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 / Why can I not print text to the screen when Sprites are on screen?

Author
Message
Snotrag
13
Years of Service
User Offline
Joined: 12th Aug 2011
Location:
Posted: 12th Aug 2011 10:38
I'm just starting out programming and trying to do a simple game, a sprite starts at the top of the screen and moves down to the bottom to another sprite at the bottom while a maths equation is displayed and if correct answer written the loop restarts etc.
The core program worked fine but as soon as I added the sprites everything on screen stopped being displayed? any help please.

Thanks

He who goes to bed with itchy bottom....wakes up with smelly finger!
Kezzla
16
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 12th Aug 2011 13:07
try the draw to screen command and print the text every loop.
that should get the text on screen.
kezzla

Sometimes I like to use words out of contents
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 12th Aug 2011 14:05
To get rid of the blue screen that shows up when we use sprites we usually grab the background and use PASTE IMAGE to replace it every loop. And as Kezzla said print the text every loop.



Snotrag
13
Years of Service
User Offline
Joined: 12th Aug 2011
Location:
Posted: 18th Aug 2011 07:29
Thanks guys that helped heaps. Kinda getting to grips with drawing basic sprites on screen now but I do have a question.Its regarding the graphic under your post GROG. Anti GOTO order. I read that its not good practice but my question is. I have menu with 4 options. and obviously you need to send them to different parts of the code when each are selected. If you cant use GOTO GAMESTART etc what are you supposed to do instead??

He who goes to bed with itchy bottom....wakes up with smelly finger!
Bursar
16
Years of Service
User Offline
Joined: 17th Sep 2008
Location:
Posted: 18th Aug 2011 13:05
Use functions instead.
Kezzla
16
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 18th Aug 2011 14:50 Edited at: 18th Aug 2011 14:51
The main reason to avoid goto command is to promote clarity in code, and to avoid stack errors.

there is an extremely good tutorial on the subject here

http://forum.thegamecreators.com/?m=forum_view&t=96505&b=7

hope this helps
kezzla

Sometimes I like to use words out of contents
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 19th Aug 2011 01:17
@ Snotrag:

The link that Kezzla posted is a great teaching tool on how to avoid GOTO. I'm glad he posted that since I'm a bit sick and too lazy to go into details.

Login to post a reply

Server time is: 2024-11-22 18:44:20
Your offset time is: 2024-11-22 18:44:20