Confused.... Help Please!


Closed Thread
Results 1 to 32 of 32

Hybrid View

  1. #1
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default

    To make the button gosub instead of goto to, 1 solution is :
    Code:
    main 
     button goto no_ship 'if button is NOT pressed, skip the gosub
     gosub ship   ' if button was pressed gosub and return
    no_ship
     button goto no_fire 
     gosub fire
    no_fire
    ....
    goto main
    As for the multi press and the way you are doing it, you have to check for when the button is released also. So when you have a button press, set a flag, then next time through the loop, if the flag is set, ignore the press. when the button is released, clear the flag.

    If cnt2==cnt gosub add

    you can move this line outside of the for next loop. It will be true each time the loop counts to cnt. so just process it before jumping back to main.

    as for the counting, you could use a timer setup as a counter. Just load it with a number, then in your mainloop check for an overflow. If it did, call your add. This way, as the levels get harder, just change the preload for the timer.
    Last edited by cncmachineguy; - 7th October 2010 at 19:31.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  2. #2
    Join Date
    Sep 2010
    Posts
    17


    Did you find this post helpful? Yes | No

    Default

    ahhh yes of course... *facepalms*

    I will go about adding a flag in there now, seems I had a bit of a well I dunno what to call it actually lol

    That will solve the final few problems and a first draft version will be ready =)

    I havnt added the "n" bit yet or proper scoring system (it just counts the ammount you shot) but it does have lives, levels, shooting anywhere, etc etc etc...

    just a matter of time

  3. #3
    Join Date
    Sep 2010
    Posts
    17


    Did you find this post helpful? Yes | No

    Default Version 1

    Forgot about this thread,

    First version is complete and has basic scoring with increasing difficulty and levels, will be adding proper scoring, motherships (n) and sound when I can get the bits.

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts