Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
game movement
#21
1) Your circle formula is way too complicated.
2) You're just looking at the circumference of the circle, but you need to make "lines" from the center out to the circumference.
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#22
Code:
CLS
SCREEN 12
DIM map(16, 19)
FOR y = 1 TO 19
FOR x = 1 TO 16
READ map(x, y)
NEXT x
NEXT y
xx = 2: yy = 3
DO
press$ = INKEY$

IF press$ = CHR$(0) + CHR$(72) AND map(xx, yy - 1) <> 1 THEN
    yy = yy - 1
    LOCATE yy + 1, xx: PRINT "."
END IF
IF press$ = CHR$(0) + CHR$(80) AND map(xx, yy + 1) <> 1 THEN
    yy = yy + 1
    LOCATE yy - 1, xx: PRINT "."
END IF
IF press$ = CHR$(0) + CHR$(75) AND map(xx - 1, yy) <> 1 THEN
    xx = xx - 1
    LOCATE yy, xx + 1: PRINT "."
END IF
IF press$ = CHR$(0) + CHR$(77) AND map(xx + 1, yy) <> 1 THEN
    xx = xx + 1
    LOCATE yy, xx - 1: PRINT "."
END IF
FOR i = 1 TO 8
SELECT CASE i
CASE 1: locy = yy - 1: locx = xx - 1
CASE 2: locy = yy - 1: locx = xx
CASE 3: locy = yy - 1: locx = xx + 1
CASE 4: locy = yy: locx = xx - 1
CASE 5: locy = yy: locx = xx + 1
CASE 6: locy = yy + 1: locx = xx - 1
CASE 7: locy = yy + 1: locx = xx
CASE 8: locy = yy + 1: locx = xx + 1
END SELECT
IF map(locx, locy) = 1 THEN LOCATE locy, locx: PRINT "#"
IF map(locx, locy) = 0 THEN LOCATE locy, locx: PRINT "."
NEXT i
LOCATE yy, xx: PRINT "@"
LOOP UNTIL press$ = CHR$(27)

DATA 1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2
DATA 1,0,0,0,0,0,1,1,1,2,1,1,1,2,2,2
DATA 1,0,0,0,0,0,0,0,1,2,1,0,1,2,2,2
DATA 1,0,0,0,0,0,1,0,1,2,1,0,1,2,2,2
DATA 1,1,1,1,1,1,1,0,1,2,1,0,1,1,1,1
DATA 2,2,2,2,2,2,1,0,1,2,1,0,0,0,0,1
DATA 1,1,1,1,1,1,1,0,1,2,1,0,0,0,0,1
DATA 1,0,0,0,0,0,0,0,1,1,1,0,1,1,1,1
DATA 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
DATA 1,0,0,0,0,0,0,0,1,1,1,0,1,1,1,1
DATA 1,1,1,1,1,1,1,1,1,1,1,0,1,2,2,2
DATA 2,2,2,2,2,2,2,1,0,1,1,0,1,2,2,2
DATA 2,1,1,1,1,1,1,1,0,1,1,0,1,2,2,2
DATA 2,1,0,0,0,0,0,1,0,1,1,0,1,2,2,2
DATA 2,1,0,0,0,0,0,1,0,1,1,0,1,2,2,2
DATA 2,1,0,0,0,1,1,1,0,1,1,0,1,2,2,2
DATA 2,1,0,0,0,0,0,0,0,0,0,0,1,2,2,2
DATA 2,1,0,0,0,1,1,0,1,1,1,0,1,2,2,2
DATA 2,1,1,1,1,1,1,1,1,2,1,1,1,2,2,2
thank you whitetiger
Reply
#23
Huh? Whitetiger didn't even post here...
And cool! I wish I knew how to do that...
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply
#24
i used whitetiger's select case idea insted of trig. i was thinking of doing that just didnt figure it out, then i saw his little game.
Reply
#25
I’m stumped. How can I move and check if I’m in a room so it prints out a full room instead of the dots around the at sign. I have been told use the line formula and make a circle. i don’t get it. Doesn’t work for me.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)