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

  1. 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.
     
  2. jcsd
  3. Re: I need help programming in Chipmunk Basic with arrow keys, and random coordinate

    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.
     
  4. Re: I need help programming in Chipmunk Basic with arrow keys, and random coordinate

    It gave me a type mismatch error in line 20
     
  5. Re: I need help programming in Chipmunk Basic with arrow keys, and random coordinate

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

    Thanks ALL!!!
     
Know someone interested in this topic? Share this thead via email, Google+, Twitter, or Facebook

Have something to add?