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
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...
Back
Top