Inkey$?

STOS-related stuff in here please

Moderators: exxos, simonsunnyboy, Mug UK, Zorro 2, Moderator Team

Atari65XE Man
Retro freak
Retro freak
Posts: 15
Joined: Fri Nov 04, 2011 9:58 pm

Inkey$?

Postby Atari65XE Man » Tue Sep 15, 2015 10:18 pm

I have to do inkey$ for pressing S or Spacebar to start the game but I keep getting error :(


10 A$=inkey$
20 if A$="s" then print "start game"

Above as I did the testing but I dont know why I got error

Atari65XE Man
Retro freak
Retro freak
Posts: 15
Joined: Fri Nov 04, 2011 9:58 pm

Re: Inkey$?

Postby Atari65XE Man » Tue Sep 15, 2015 10:19 pm

P.S. Sorry for double Post topic as I had internet problem!

User avatar
exxos
Hardware Guru
Hardware Guru
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Re: Inkey$?

Postby exxos » Tue Sep 15, 2015 10:25 pm

Atari65XE Man wrote:I have to do inkey$ for pressing S or Spacebar to start the game but I keep getting error :(


10 A$=inkey$
20 if A$="s" then print "start game"

Above as I did the testing but I dont know why I got error


Looks ok to me, what error did you get ?
4MB STFM 1.44 FD- VELOCE+ 020 STE - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - various clutter

http://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
http://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.
http://ataristeven.exxoshost.co.uk/Steem.htm Latest Steem Emulator

User avatar
exxos
Hardware Guru
Hardware Guru
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Re: Inkey$?

Postby exxos » Tue Sep 15, 2015 10:32 pm

Code: Select all

10 A$=inkey$
20 if A$="s" then print "start game" : end
30 goto 10


Strangly line 20 if your code that I copied and pasted into a text file did not import :shrug:

That above code works and here is a ASC file of it
1.asc
That you can import into STOS.
You do not have the required permissions to view the files attached to this post.
4MB STFM 1.44 FD- VELOCE+ 020 STE - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - various clutter

http://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
http://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.
http://ataristeven.exxoshost.co.uk/Steem.htm Latest Steem Emulator

EstTeeEfEm
Captain Atari
Captain Atari
Posts: 299
Joined: Mon May 04, 2015 9:02 pm

Re: Inkey$?

Postby EstTeeEfEm » Tue Oct 06, 2015 6:19 am

As a further note ... if
a$="a"
is DIFFERENT from
a$="A"

Dumbest thing in the world, make sure CAPS is OFF or ON depending on what you want to use!

User avatar
exxos
Hardware Guru
Hardware Guru
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Re: Inkey$?

Postby exxos » Tue Oct 06, 2015 6:59 am

EstTeeEfEm wrote:As a further note ... if
a$="a"
is DIFFERENT from
a$="A"

Dumbest thing in the world, make sure CAPS is OFF or ON depending on what you want to use!


Use the space bar instead of "s" to start game ;)

You could probably do something like if A$="a" or A$="A" then...

or use if UPPER$(A$) ="A" then.....

That way it would not matter if caps clock was on or not... or to save on checking code... A$=UPPER$(INKEY$)
4MB STFM 1.44 FD- VELOCE+ 020 STE - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - various clutter

http://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
http://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.
http://ataristeven.exxoshost.co.uk/Steem.htm Latest Steem Emulator


Social Media

     

Return to “STOS”

Who is online

Users browsing this forum: No registered users and 1 guest

cron