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


by CharlieO1212
Tags: arrow, basic, chipmunk, coordinate, keys, programming, random
CharlieO1212
CharlieO1212 is offline
#1
Apr23-12, 02:51 PM
P: 10
I am trying to make a game in Chipmunk Basic using the arrow keys but I cant 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 dont 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.
Phys.Org News Partner Science news on Phys.org
Simplicity is key to co-operative robots
Chemical vapor deposition used to grow atomic layer materials on top of each other
Earliest ancestor of land herbivores discovered
Bill Simpson
Bill Simpson is offline
#2
Apr23-12, 04:24 PM
P: 972
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.
CharlieO1212
CharlieO1212 is offline
#3
Apr23-12, 04:58 PM
P: 10
It gave me a type mismatch error in line 20

CharlieO1212
CharlieO1212 is offline
#4
Apr23-12, 06:45 PM
P: 10

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


If you see this reply please go to this link because I wanted to make an new post that re-phrased my question. http://www.physicsforums.com/showthr...31#post3880431. If this doesnt work then just search my name and look for the post on programming (not this one).

Thanks ALL!!!


Register to reply

Related Discussions
For computer game programming use: The damage of an arrow Calculus 0
Cat vs. chipmunk General Discussion 4
Very basic coordinate problem Calculus & Beyond Homework 4
Random coordinate General Math 14
Borland C++ 5.0 input using arrow keys Programming & Computer Science 3