====== STICK ====== /* Remove the comments after creating content for each section.*/ Returns current information, as an integer, about a joystick /* For the lines below, just create links, separated by commas, to other pages of the BASICs section, like [[:basics:basicTagName]]. "Implemented by" should mention BASICs which implement the keyword like described, in a more usual and standard way. "With variations" should point to BASICs where this keyword is used a bit differently. "Also written as" should list alternative spellings and abbreviations this keyword has. No need to refer to a BASIC, there is a section for that later. */ **Implemented by:** [[:basics:Atari:]], [[:basics:GWBASIC:]], [[:basics:MSX:]], [[:basics:msqb:QBasic]], [[:basics:VBDOS:]], [[:basics:FreeBASIC:]] **With variations:** **Also written as: ** ===== Usage ===== /* For inline examples of syntax, write the keyword between '' and '' (two single quotes) */ The joystick interface is far from being a standard among BASIC implementations. In the 8-bit era, there were analog and the Atari-standard joystick. Some machines supported both, most only one, and some just had no BASIC support for joysticks. In the [[:basics:msqb|MS-QuickBASIC]] family, STICK returns one of the current coordinates of one of the joysticks, according to the given numerical argument: * 0 - Joystick A horizontal position * 1 - Joystick A vertical position * 2 - Joystick B horizontal position * 3 - Joystick B vertical position Oddly, for any other argument but 0, a previous call to STICK(0) is required in order to record all joystick coordinates. ==== Variations ==== === MSX === In [[:basics:msx|MSX BASIC]], STICK returns the current //state// of an Atari-standard joystick or the keyboard cursor keys. The STICK argument tells the device to be scanned: * 0 - keyboard cursor keys * 1 - joystick A * 2 - joystick B The return value of STICK will be one of: * 0 - no direction * 1 - up * 2 - up-right * 3 - right * 4 - down-right * 5 - down * 6 - down-left * 7 - left * 8 - up-left ===== Examples ===== /* Below is an example of a code block, using GeSHi syntax highlighting for //gwbasic//. Other styles of interest might be //basic4gl//, //blitzbasic//, //freebasic//, //gambas//, //locobasic//, //purebasic//, //qbasic//, //sdlbasic//, //thinbasic//, //vb//, //vbnet//, //xbasic// or //zxbasic//. 10 PRINT "HELLO" */ ===== Comments ===== /* Origin of the keyword, opinions, history... */ ===== Related keywords ===== /* Keywords that are often or always used along this one */ * [[STRIG]] ===== Similar keywords ===== /* Keywords with the same or similar functionality found in other versions of BASIC */ ===== In other languages... ===== /* For parallels and comparisons with other modern-day languages */ ===== References ===== /* If you used the ((citation)) syntax elsewhere in the text, they will appear under this section. But you can write some recommendations of books, magazines, etc */ /* ===== TAGS ===== Please use the syntax below for adding tags to this page, separated by spaces (use quotes for tags with spaces). The most important tags to be used are, separated by groups: - Statements | Commands | SpecialVariables | Operators {{tag>tagName}} */ {{tag>Functions Console IO Gaming}}