Home | Reviews | GUIpedia | Forum | Fun500


Lil\' 1 day game for Cobra
I made a game for Cobra 2K9 called Line Stepper, fun, I didn't copy anything, I just thought it up one day, well yesterday, Here's the code: :cheer: DECLARE SUB rcu (curx!, cury!, sx!, sy!) DECLARE SUB dg () DECLARE SUB rcu2 (curx!, cury!, sx!, sy!, t!) DECLARE SUB dc (x!, y!) DECLARE SUB dgp (a!, B!) '$INCLUDE: 'qb.bi' RANDOMIZE TIMER SCREEN 13 FOR a = 1 TO 10 FOR B = 1 TO 10 LINE (a * 17 - 10, B * 17)-STEP(17, 17), 3, BF LINE (a * 17 - 10, B * 17)-STEP(17, 17), 14, B NEXT NEXT COLOR 14 PRINT "Line Stepper" tno1 = 10 tno2 = 10 DIM SHARED steps DIM SHARED grid(9, 9) FOR a = 0 TO 9 grid(a, 0) = 1 grid(a, 9) = 2 NEXT FOR a = 1 TO 10 FOR B = 1 TO 10 LINE (a * 17 - 10, B * 17)-STEP(17, 17), grid(a - 1, B - 1), BF LINE (a * 17 - 10, B * 17)-STEP(17, 17), 14, B NEXT NEXT DO current$ = "Blue " steps = INT(RND * 3) + 1 COLOR 15 LOCATE 3, 25 PRINT "Steps: "; steps LOCATE 5, 25 PRINT "Player: "; current$ LOCATE 7, 25 PRINT "Select " + current$ 59734339 rcu x, y, 1, 1 IF grid(x - 1, y - 1) 1 THEN GOTO 59734339 IF grid(x - 1, y - 1) = 1 THEN grid(x - 1, y - 1) = 0 dgp x, y LOCATE 7, 25 PRINT "Move " + current$ + " " rcu2 x, y, x, y, steps grid(x - 1, y - 1) = 1 dg END IF current$ = "Green" steps = INT(RND * 3) + 1 COLOR 15 LOCATE 3, 25 PRINT "Steps: "; steps LOCATE 5, 25 PRINT "Player: "; current$ LOCATE 7, 25 PRINT "Select " + current$ 59734332 rcu x, y, 10, 10 IF grid(x - 1, y - 1) 2 THEN GOTO 59734332 IF grid(x - 1, y - 1) = 2 THEN grid(x - 1, y - 1) = 0 dgp x, y LOCATE 7, 25 PRINT "Move " + current$ + " " rcu2 x, y, x, y, steps grid(x - 1, y - 1) = 2 dg END IF LOOP SUB dc (x, y) PSET (x * 17 - 10 + 8, y * 17 + 8), 15 DRAW "d5u5r5g5" END SUB SUB dg FOR a = 1 TO 10 FOR B = 1 TO 10 LINE (a * 17 - 10, B * 17)-STEP(17, 17), grid(a - 1, B - 1), BF LINE (a * 17 - 10, B * 17)-STEP(17, 17), 14, B NEXT NEXT END SUB SUB dgp (a, B) LINE (a * 17 - 10, B * 17)-STEP(17, 17), grid(a - 1, B - 1), BF LINE (a * 17 - 10, B * 17)-STEP(17, 17), 14, B END SUB SUB rcu (curx, cury, sx, sy) curx = sx cury = sy dc curx, cury DO a$ = INKEY$ IF curx 1 AND a$ = CHR$(0) + "K" THEN dgp curx, cury curx = curx - 1 dc curx, cury END IF IF cury 1 AND a$ = CHR$(0) + "H" THEN dgp curx, cury cury = cury - 1 dc curx, cury END IF IF cury 10 AND a$ = CHR$(0) + "P" THEN dgp curx, cury cury = cury + 1 dc curx, cury END IF IF curx 10 AND a$ = CHR$(0) + "M" THEN dgp curx, cury curx = curx + 1 dc curx, cury END IF LOOP UNTIL a$ = CHR$(13) dgp curx, cury END SUB SUB rcu2 (curx, cury, sx, sy, t) curx = sx cury = sy dc curx, cury FOR att = t TO 1 STEP -1 LOCATE 3, 25 PRINT "Steps: "; att DO c = 0 a$ = INKEY$ IF curx 1 AND a$ = CHR$(0) + "K" THEN c = 1 dgp curx, cury curx = curx - 1 dc curx, cury END IF IF cury 1 AND a$ = CHR$(0) + "H" THEN c = 1 dgp curx, cury cury = cury - 1 dc curx, cury END IF IF cury 10 AND a$ = CHR$(0) + "P" THEN c = 1 dgp curx, cury cury = cury + 1 dc curx, cury END IF IF curx 10 AND a$ = CHR$(0) + "M" THEN c = 1 dgp curx, cury curx = curx + 1 dc curx, cury END IF LOOP UNTIL c = 1 NEXT dgp curx, cury END SUB
2009-02-079:36 PM

SonicBritRe:Lil\' 1 day game for Cobra
Dude thats actually an interesting game. (one error in the code pasting, the board is interpreting the b ) as B) ), just use the code button and paste the code inside of the code tags. Some suggestions, keep score somehow, track when one colour overrides another colour, and keep a tally of the current pieces in play. (just before you move the piece note the colour used the decrease a variable). That way you can show who wins at the end. Also a possible different mode of play is to randomise the board so the pieces are in different squares to begin with (make sure not to replace an existing piece though ;)) One slight bug is that your colour can override a colour of the same type, blue on blue and green on green, you could either prevent the move or just count it against the player.
2009-02-0710:47 PM

Re:Lil\' 1 day game for Cobra
[b]sonicbrit wrote:[/b] [quote]Dude thats actually an interesting game. (one error in the code pasting, the board is interpreting the b ) as B) ), just use the code button and paste the code inside of the code tags. Some suggestions, keep score somehow, track when one colour overrides another colour, and keep a tally of the current pieces in play. (just before you move the piece note the colour used the decrease a variable). That way you can show who wins at the end. Also a possible different mode of play is to randomise the board so the pieces are in different squares to begin with (make sure not to replace an existing piece though ;)) One slight bug is that your colour can override a colour of the same type, blue on blue and green on green, you could either prevent the move or just count it against the player.[/quote] Thanks for reviewing the game :cheer: I've started to make scorring, also I'm putting in a part which will activate a function when none of blue or green is left. Thanks again :)
2009-02-0711:22 PM

BASIC Programming Help


2021 Brandon Cornell