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 / Flashing strings!...sorta

Author
Message
best seclub
16
Years of Service
User Offline
Joined: 22nd May 2008
Location:
Posted: 2nd Jun 2008 15:43
So,i paste a loaded 1024x768 image on the screen.Then i continue the code.I write a code that prints 3 text strings on the screen.The image code as well as the text code are surrounded by do-loop.Also sync before loop.The problem is when i execute the code,the texts appear and disappear at very hight speed.Why?Because the image and texts loop together?Am i using sync uncorrectly?Please help,i feel stupid...

books->movies->games
DB PROgrammer
17
Years of Service
User Offline
Joined: 9th Feb 2007
Location: Nowhere But Everywhere
Posted: 2nd Jun 2008 16:08
Can you show the code?


I'm Pro grammer.
best seclub
16
Years of Service
User Offline
Joined: 22nd May 2008
Location:
Posted: 2nd Jun 2008 16:23
Ehehe...OK.Heres the code.Please dont laugh if its poor or just stupid.Im just a regular guy who wants to make his own game...

books->movies->games

Attachments

Login to view attachments
best seclub
16
Years of Service
User Offline
Joined: 22nd May 2008
Location:
Posted: 2nd Jun 2008 17:11
^ I put the paste image in the main loop a while ago.Just a stupid mistake.As for the sync rate,ill try that right away.

books->movies->games
best seclub
16
Years of Service
User Offline
Joined: 22nd May 2008
Location:
Posted: 2nd Jun 2008 17:18
I tried it.Now it doesnt flash,thanks,but a veeery small but-now the downkey and upkey dont work...

books->movies->games
pcRaider
17
Years of Service
User Offline
Joined: 30th May 2007
Location:
Posted: 2nd Jun 2008 17:37
`selectedItem=1


best seclub
16
Years of Service
User Offline
Joined: 22nd May 2008
Location:
Posted: 2nd Jun 2008 17:49 Edited at: 2nd Jun 2008 17:56
^Aww,how stupid of me...thanx.
I placed the selectedItem in the main loop.Thats what you ment,right?

books->movies->games
pcRaider
17
Years of Service
User Offline
Joined: 30th May 2007
Location:
Posted: 2nd Jun 2008 18:10
selectedItem=1
You place it in the outside of a main loop.

best seclub
16
Years of Service
User Offline
Joined: 22nd May 2008
Location:
Posted: 2nd Jun 2008 18:17
^Yeah,exactly.Thanx man.
PS.I know im a big pain in the neck,but one more tiny question XD :upkey(),downkey()...any link that has the names of all buttons?I tried enterkey(),but it didnt work

books->movies->games
pcRaider
17
Years of Service
User Offline
Joined: 30th May 2007
Location:
Posted: 2nd Jun 2008 18:30 Edited at: 2nd Jun 2008 18:38
you can use KEYSTATE().



this is SCANCODE
best seclub
16
Years of Service
User Offline
Joined: 22nd May 2008
Location:
Posted: 2nd Jun 2008 18:50
Yowza!I dont know how to thank you guys!Is there any 'reputation' button here?

books->movies->games
best seclub
16
Years of Service
User Offline
Joined: 22nd May 2008
Location:
Posted: 3rd Jun 2008 10:30
Okay,kill me if you want,but i modified the code above and the following line doesnt work:
if selectedItem=1 and KEYSTATE(156)=1 then goto game_subroutine .This code was placed just after the final line.But it doesnt work.What gives.156 is Enter...im so confused.

books->movies->games
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 3rd Jun 2008 10:46
156 is ENTER only on the numpad; the other key labeled ENTER is actually RETURN...scan code for RETURN is 28.
best seclub
16
Years of Service
User Offline
Joined: 22nd May 2008
Location:
Posted: 3rd Jun 2008 11:25
^ Thanks,i dont know why my tutorial didnt mention it..

books->movies->games
best seclub
16
Years of Service
User Offline
Joined: 22nd May 2008
Location:
Posted: 3rd Jun 2008 14:52
Still doesnt work.Do i need to type something like Clear screen before switching between menus?

books->movies->games
best seclub
16
Years of Service
User Offline
Joined: 22nd May 2008
Location:
Posted: 3rd Jun 2008 16:43
^ So thats what 'cls' is all about.Ugh...

books->movies->games
best seclub
16
Years of Service
User Offline
Joined: 22nd May 2008
Location:
Posted: 3rd Jun 2008 19:00
This just isnt working...
I even tried "gosub" instead of "goto".I tried returnkey()=1 instead of KEYSTATE(28)=1.Why doesnt the subroutine end and go to the 2nd subroutine??I dont know what code to add more...

books->movies->games
RedFlames
17
Years of Service
User Offline
Joined: 25th Aug 2007
Location: Germania
Posted: 3rd Jun 2008 19:46
Quote: "This code was placed just after the final line."


but it is still inside the main loop? otherwise it'd never be reached.

best seclub
16
Years of Service
User Offline
Joined: 22nd May 2008
Location:
Posted: 3rd Jun 2008 21:17
^ nooo... Oh,man.my coding sucks...

books->movies->games
best seclub
16
Years of Service
User Offline
Joined: 22nd May 2008
Location:
Posted: 4th Jun 2008 10:13
Okay,still my code doesnt work.The new image from the new subroutine loads and quickly exits. Then DarkBASIC crashes.Please have a look at the code.

books->movies->games

Attachments

Login to view attachments
best seclub
16
Years of Service
User Offline
Joined: 22nd May 2008
Location:
Posted: 4th Jun 2008 13:52
^ Never mind...got it fixed.I placed the "load music" outside of the loop (same mistake again).Also added "cls" to the subroutine.Also added "delete music 1" so i can use different music in-game.

books->movies->games

Login to post a reply

Server time is: 2024-11-25 23:39:05
Your offset time is: 2024-11-25 23:39:05