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 / scroll menu

Author
Message
Hippie Dude
19
Years of Service
User Offline
Joined: 6th Feb 2005
Location: California, United States
Posted: 7th Jan 2006 01:30
Help!! I am making a title screen to my game and I want it to change selection when you use the arrowkeys. Instead of going through each one, it just skips from the first one to the second one.


Mysteries Surround You
Jerok
19
Years of Service
User Offline
Joined: 7th May 2005
Location: Mars. Wait a sec I\'m on MARS. OMG
Posted: 7th Jan 2006 02:05 Edited at: 7th Jan 2006 02:06
this is simple there is nothing wrong with you code it is just that
1. loops go extremely fast and it wouls seem like it is going down to the last.
2. also darkbasic reads code iine by line so after the first line becomes true your second becomes true because youve incresed the veriables to make it true and so on

here is a code that will work.
what it does is once the downkey is pressed it sets variables to check if it has gone through the code once so you have to let go of the downkey for it to be able to restart.


TKsFox
18
Years of Service
User Offline
Joined: 25th Nov 2005
Location: No no no - Its not the Cyberspace
Posted: 7th Jan 2006 14:42
Y not using a variable?

u use AllowUp and AllowDown they r 1 if the given arrow isnt pressed
and if the key is pressed u check if the Allow one is 1 - then u add +1 (up) or -1 (down) to a variable named Line.

It's me...
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 7th Jan 2006 15:37
Quote: "Y not using a variable?"


I had the same thought. Using a variable (with an array) is the easiest way to make a text driven menu.

Hope this helps.




Hippie Dude
19
Years of Service
User Offline
Joined: 6th Feb 2005
Location: California, United States
Posted: 16th Jan 2006 22:19
thanks Jerok, your code is exactly what I needed!

Mysteries Surround You

Login to post a reply

Server time is: 2024-09-24 13:23:24
Your offset time is: 2024-09-24 13:23:24