Jump to content

Photo

Help with Zombie Attack game?

help game programming zombie attack batari basic game-making

3 replies to this topic

#1 JWinslow23 OFFLINE  

JWinslow23

    Combat Commando

  • 5 posts

Posted Tue Jun 11, 2013 6:28 PM

set kernel_options playercolors player1colors

dim zombiewalk=a
dim zombiewalk2=b
dim zombiewalkdelay=c
dim zombiewalk2delay=d
dim zombiespeed=e
dim ballwasshot=f

CTRLPF=$21

playfield:
................................
................................
................................
................................
................................
................................
................................
................................
................................
................................
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
end

player0:
%1101100
%0100100
%0100100
%0100100
%0100100
%0010100
%0001000
%0001011
%1111111
%1111111
%0101010
%0011100
%0001000
%0011100
%0100010
%1000001
%1000001
%1000001
%0100010
%0011100
end

player1color:
$F0
$F0
$F0
$F0
$F0
$F0
$F4
$F4
$F4
$F4
$F4
$F4
$F4
$F4
$C4
$C4
$C4
$C4
$C4
$C4
end

player1:
%00011001
%00010010
%00010010
%00010010
%00011110
%00010000
%00011110
%10011100
%10011000
%10111101
%10111101
%10111001
%01111110
%00011100
%00011110
%00110001
%00111111
%00110101
%00111111
%00011110
end

COLUBK=6
COLUPF=244
player0x=138
player0y=79
player1x=17
player1y=79
zombiespeed=20
ballheight=1
ballx=139
bally=71
ballwasshot=0

loop
drawscreen
player1:
%00011001
%00010010
%00010010
%00010010
%00011110
%00010000
%00011110
%10011100
%10011000
%10111101
%10111101
%10111001
%01111110
%00011100
%00011110
%00110001
%00111111
%00110101
%00111111
%00011110
end

if zombiewalk=1 then player1:
%01100110
%01000100
%00100100
%00100100
%00011000
%00010000
%00011110
%10011100
%10111000
%10111010
%10111010
%10111010
%01111110
%00011100
%00011110
%00110001
%00111111
%00110101
%00111111
%00011110
end

if switchreset then reboot
if joy0left then player0x=player0x-1
if joy0right then player0x=player0x+1
if !joy0fire && !ballwasshot then ballx=player0x+1
if joy0fire then ballwasshot=1
if ballwasshot then ballx=ballx-2
if player0x>138 then player0x=138
if player0x<16 then player0x=16
if player1x>138 then player1x=138
if collision(ball,player1) then player1x=16:ballx=player0x+1:ballwasshot=0:score=score+1
zombiewalkdelay=zombiewalkdelay+1
if zombiewalkdelay=zombiespeed then zombiewalk=zombiewalk+1:zombiewalkdelay=0:player1x=player1x+1
if zombiewalk=2 then zombiewalk=0
goto loop

The code was compiling and executing fine a while ago, but now, wherever I place my cursor, there is a syntax error there.

Any tips?

#2 RevEng OFFLINE  

RevEng

    Bit Player

  • 5,214 posts
  • Location:bottom of the stack

Posted Tue Jun 11, 2013 6:54 PM

Two things stand out.

First, none of your posted code is indented.

Second, you've picked two kernel options and there isn't an entry on the kernel options chart for only those two options. Pick a line from the chart, and add all the options on that line.

Fix up the indenting and comment out your kernel options line (for now) and your code should compile.

#3 JWinslow23 OFFLINE  

JWinslow23

    Combat Commando

  • Topic Starter
  • 5 posts

Posted Wed Jun 12, 2013 7:56 AM

1. Funny. When I put the code in, it was indented. Should've put the .bas up for download.
2. The bB help that came with VisualbB said it could be done.

I'll come up with a better code in a few days.

#4 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • 29,028 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Wed Jun 12, 2013 10:59 AM

2. The bB help that came with VisualbB said it could be done.


What help is that? Where can I find it?





Also tagged with one or more of these keywords: help, game, programming, zombie, attack, batari, basic, game-making

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users