Qb64如何移动数据表制作的精灵

时间:2019-07-03 00:17:01

标签: qb64

我正在尝试制作一个自上而下的测试游戏,但是我想使用由数据表制作的精灵,我将如何去做,这就是我目前所拥有的。

SCREEN 12
DIM keypress AS STRING
DIM x AS INTEGER
DIM y AS INTEGER
DIM c AS INTEGER
CONST size = 5
x = 320
y = 200
c = 5
CLS



DO

    keypress = UCASE$(INKEY$)
    IF keypress = "A" AND x > size THEN
        x = x - 1
        CLS
    ELSEIF keypress = "D" AND x < 480 - size THEN
        x = x + 1
        CLS
    ELSEIF keypress = "W" AND y > size THEN
        y = y - 1
        CLS
    ELSEIF keypress = "S" AND y < 640 - size THEN
        y = y + 1
        CLS
        CIRCLE (x, y), size, c
    END IF

    COLOR
LOOP UNTIL keypress = "Q"



sprite_1:
DATA line (320,200)-(350,200)
DATA line (350,200)-(350,210)
DATA line (360,210)-(350,210)
DATA line (350,210)-(250,200)

我是否必须将数据表上的每个点都作为变量广告来定义它们?

0 个答案:

没有答案