Confused.... Help Please!


Results 1 to 32 of 32

Threaded View

  1. #1
    Join Date
    Sep 2010
    Posts
    17

    Default Confused.... Help Please!

    Hi,

    I am kind of new to programming using PICBasic Pro, my dad who is the hardware guru around here has made me a board specifically for a little project I am working on but I have hit a hurdle and need some assistance.

    Basically what I am trying to make is (if any of you are familiar with it) a clone of the good old Casio calculator game "Digital Invaders" found here Digi Invaders

    The scoring system and all that will be fine as I have already planned that part out as a seperate Block, the problem I am having is getting the randomly generated numbers (which I have generated in an array of 30 Bytes on start) to scroll across the screen AND check to see if they are shot...

    I can get numbers to scroll across the screen fine using the following example ignore the comments positions...

    Code:
    FOR T = 144 TO 131 STEP -1
      'LCDOUT $FE, 1
      LCDOUT $FE,T,#NOS[CURNO]          'OUTPUT TO LCD SLIDE
      PAUSE 1000
      CURNO = CURNO + 1
      'IF CURNO >= 31 THEN GOSUB ARRAY                                 'IN FROM LEFT LINE 1
      NEXT
    Where T = Var Byte
    NOS = Array or []
    and CURNO = Var BYTE

    This of course adds to the left of the line 1 by 1, which gives me the basic fundamentals for scrolling across the screen however... I need the number to be added behind the existing numbers whilst also checking to see if the first number has been "Shot" and removing it e.g.

    "4: 4913827" needs to remove the number 4 on button press and continue adding numbers on the end and shifting left where 9 moves to where 4 was etc etc

    how can i go about this? I was thinking of rebuilding the array everytime a number is shot and shifting them all down an index, but i am still stuck on how I continue from where the last number was removed since I need to also check to see if a number has hit the : mark (I have that bit working in a Block of its own)

    p.s. by Module I mean blocks of code dedicated to each seperate area of the overall whole I.E. Array: Start: etc etc

    Thanks

    Edit: forgot to mention I am using a PIC16F627 for the first beta and plan on using 628 for the next 3-4 boards I replicate from this (with the required changes)

    Edit2: I have read that PicBasic (non Pro) has STRING support such as Right$ Left$ Mid$ etc? is this the case? what are the differences between the normal version and PRO?
    Last edited by UKIkarus; - 27th September 2010 at 13:13.

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