Jump to content
IGNORED

Having some problems with missiles


Retro Lord

Recommended Posts

Hello everyone. I'm working on my first game called "Zombie House" and I've come a long way thanks to RandomTerrains webpage. But, I'm having a bit of a hard time grasping missiles. I'm using " set kernel_options player1colors playercolors pfcolors"

in my game and it seems I can't use missiles with it. So I resorted to using the ball instead. The thing I'm having trouble with is that the aim of the game is to shoot zombies and as you walk about you fire in the direction your facing, but when you turn the ball turns too instead of going in the fired direction. I want too be able too fire left and right.

 

What advice would you have on this situation?

 

Many thanks in advance.

Link to comment
Share on other sites

Hm, another question, what is the simplest way to do scrolling, either horizontal or vertical? I've experimented with pfscroll but when I add

"pfscroll left" it dosn't do anything. And when I add "pfscroll up" the playfield just sort of jerks in a small up and down motion. Is this due to the playfield size? How small or big should it be for it too work? At the moment I have the standard size for a screen.

 

Thanks in advance.

Link to comment
Share on other sites

Nevermind, I figured out how to use pfvline and even how I set the speed. Now, I have another question that is related too pfvline.

How would I go about if I wanted a hole too appear at a random spot on the line?

 

I'm using this for my horizontal scrolling:

 

 

dim rand16 = z

pfvline 0 0 10 on
pfvline 31 4 8 off
pfvline 8 2 4 flip

main

 

u=u+1

if u=15 then u=1

 

 

 

 

if u=1 then pfscroll left



if playfieldpos <> 8 then goto __Skip_Draw

temp5 = rand : temp6 = rand/2

if temp5 > temp6 then var44 = 0 : var45 = 0 : var46 = 0 : var47 = 0 : goto __Skip_Draw

var44 = rand : var45 = rand : var46 = rand : var47 = rand

__Skip_Draw

 

draw_loop


goto main

 

 

 

 

 

 

 

 

Entire game source:

  rem CODE INSPIRED BY Atarius Maximus at http://www.atariage.com/forums/index.php?showtopic=109288
 set smartbranching on


  player0x = 30
  player0y = 50

 player1x=135
 player1y=50

 scorecolor = $68

 ballx = 200
 bally = 200

   dim rand16 = z

   pfvline 0 0 10 on
   pfvline 31 4 8 off
   pfvline 8 2 4 flip

main

 COLUP0 = $2E
 COLUP1 = $3A
 COLUPF = $0A

   dim _P0_L_R = player0x.a
   dim _P0_U_D = player0y.b

   dim _P1_L_R = player1x.c
   dim _P1_U_D = player1y.d

 g=g

 u=u+1

 if u=15 then u=1

  f=f+1
  rem POSSIBLY INEFFICIENT CODE, SEPARATE COLOR INFO FOR EACH FRAME...
  if f = 10 then player0:
        %00100100
        %00100100
        %00100100
        %00100100
        %00100100
        %00011000
        %00011000
        %00011000
        %00011000
        %00011000
        %00011110
        %00000011
        %00011000
        %00011000
        %00011100
        %00011000
end

  if f = 20 then player0:
        %01000010
        %01000010
        %01000010
        %00100100
        %00100100
        %00011000
        %00011000
        %00011000
        %00011000
        %00011000
        %00011110
        %00000011
        %00011000
        %00011000
        %00011100
        %00011000
end


  if f=20 then f=0










  h=h+1
  rem POSSIBLY INEFFICIENT CODE, SEPARATE COLOR INFO FOR EACH FRAME...
  if h = 10 then player1:
        %00100100
        %00100100
        %00100100
        %00100100
        %00100100
        %00011000
        %00011000
        %00011000
        %00011110
        %00011000
        %00011111
        %00000000
        %00011000
        %00011000
        %00011000
        %00011000
end

  if h = 20 then player1:
        %01000010
        %01000010
        %01000010
        %00100100
        %00100100
        %00011000
        %00011000
        %00011000
        %00011110
        %00011000
        %00011111
        %00000000
        %00011000
        %00011000
        %00011000
        %00011000
end


  if h=20 then h=0




 if u=1 then pfscroll left



   if playfieldpos <> 8 then goto __Skip_Draw

   temp5 = rand : temp6 = rand/2

   if temp5 > temp6 then var44 = 0 : var45 = 0 : var46  = 0 : var47 = 0 : goto __Skip_Draw

   var44 = rand : var45 = rand : var46  = rand : var47 = rand

__Skip_Draw



  drawscreen

   if k > 0 then AUDV0 = 8 : AUDC0 = 7 : AUDF0 = 30 : k = k - 1 : if k = 0 then AUDV0 = 0

   if r > 0 then AUDV0 = 8 : AUDC0 = 8 : AUDF0 = 10 : r = r - 1 : if r = 0 then AUDV0 = 0

  if joy0up then _P0_U_D = _P0_U_D - 1
  if joy0down then _P0_U_D = _P0_U_D + 1

 if collision(ball,player1) then player1y=rand:player1x=135 : score=score+10 : ballx=200 : bally=200 : r=10

 if player1y < 25 then player1y=rand
 if player1y > 80 then player1y=rand

 _P1_L_R=_P1_L_R - 0.3 : REFP1 = 8

 if ballx>135 then goto skip
 ballx = ballx+2:goto draw_loop
skip
 if joy0fire then k=10 : ballx = player0x+7:bally=player0y-12

draw_loop


  goto main
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...