I programming in Chipmunk Basic with arrow keys, and random coordinate gen.

AI Thread Summary
The discussion centers on programming a game in Chipmunk Basic, specifically using the arrow keys and spacebar for controls. The user is attempting to create a simplified version of the snake game, where a line moves around the screen to collect colored dots. They express difficulty in implementing controls for the arrow keys and inquire about creating graphics and sprites in Chipmunk Basic, noting its differences from other Basic software. A suggested approach involves using the inkey$ function to detect key presses, with instructions to test the output of pressing various keys. The user also mentions encountering a type mismatch error and provides a link for further clarification on their issue. Overall, the thread focuses on troubleshooting input handling and graphics creation in Chipmunk Basic for game development.
CharlieO1212
Messages
10
Reaction score
0
I am trying to make a game in Chipmunk Basic using the arrow keys but I can't because I cannot figure out how. I have programmed in other Basic Softwares but I cannot figure out how to use the arrow keys and spacebar in my programs. An example (much simplified) of a game I am making is snake (if you don't know what it is its where a line goes around the screen and you need to come into contact with colored dots to make your "snake" bigger. If you run into yourself then the game ends). IF you know how to make graphics/sprites with colors in CB (Chipmunk Basic) then please let me know because CB is a lot different with graphics than other programs.
 
Technology news on Phys.org


Can you make this work?

while
s=inkey$
if s<>"" then print asc(s)
wend

Test that by gently pressing a single key, like X or 3.
If that works then gently press one arrow key and post the results.
For X it should print a single number.
For an arrow key it may print 1 or 2 or 3 or 4 lines of single numbers.

If that works then you need to build a little machine in software that uses the numbers.
 


It gave me a type mismatch error in line 20
 
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
Back
Top