how would i use inkey$ and get a$ together? do i have to use it again and again for each decision. can i make a macro in cbm basic to speed up the process?
this is the line i am trying to fix
8 let a$=inkey$:get a$
:if a$="t" then goto 1
00
the problem is that it never works, it just goes to the end of the game. ideas?
working on version 2 of the thing, the first one was so messed up i had to bin it.
do i have to use the inkey$ each time?
Moderator: Moderators
-
- Vic 20 Hobbyist
- Posts: 114
- Joined: Sun Mar 10, 2019 7:39 pm
- Location: lodi california
- Occupation: student
do i have to use the inkey$ each time?
Bedroom coder=rock star
modern coder= pop star
i'd rather be a rock star than a pop start
modern coder= pop star
i'd rather be a rock star than a pop start
Re: do i have to use the inkey$ each time?
inkey$ doesn't exist in CBM BASIC. It serves a similar purpose to get in other dialects.
In your example the part is essentially a no-op as it just assigns the contents of the variable in$ to a$ (variables in CBM BASIC are at most two characters).
If you want to wait for a single key you want
In your example the
Code: Select all
let a$=inkey$
If you want to wait for a single key you want
Code: Select all
8 get a$:if a$=""goto 8
-
- Vic 20 Hobbyist
- Posts: 114
- Joined: Sun Mar 10, 2019 7:39 pm
- Location: lodi california
- Occupation: student
Re: do i have to use the inkey$ each time?
thank you very much
Bedroom coder=rock star
modern coder= pop star
i'd rather be a rock star than a pop start
modern coder= pop star
i'd rather be a rock star than a pop start
- Mike
- Herr VC
- Posts: 4901
- Joined: Wed Dec 01, 2004 1:57 pm
- Location: Munich, Germany
- Occupation: electrical engineer
Re: do i have to use the inkey$ each time?
Please refer to the VIC-20 User's Manual for these kind of questions.
Especially, handling keyboard input with GET is explained with example programs on pages 89 to 92, and you find further information on GET on page 122.
Especially, handling keyboard input with GET is explained with example programs on pages 89 to 92, and you find further information on GET on page 122.