Jump to content
IGNORED

Paddles, is this right?


Retro Lord

Recommended Posts

I'm learning how to implement paddles, and I'm in a confused position right now. I think it works, but I'm not sure I don't get any error messages, but I can't move missile1 around which I've set to be moved with the paddle. It might be my settings in Stella. I set the paddle controllers to - Paddle0 decrease=w, Paddle0 increase=s, Paddle0 fire=d. But I can't do anything with Paddle0 Analog?

 

Would love some help on this one.

  rem CODE INSPIRED BY Atarius Maximus at http://www.atariage.com/forums/index.php?showtopic=109288
   set kernel_options no_blank_lines readpaddle
 include div_mul.asm



  player0x = 50
  player0y = 20

  player1x = 80
  player1y = 30

 missile1x=80 : missile1y=60


                                  dim _P1_U_D = player1y.j

                                  dim _P0_U_D = player0y.l

main

 scorecolor=$0E
 COLUP0=$E4
 COLUP1=$E4
 NUSIZ1=$20
 missile1height=3

  rem POSSIBLY INEFFICIENT CODE, SEPARATE COLOR INFO FOR EACH FRAME...
 player0:
        %00000000
        %00000000
        %00000000
        %10000001
        %01000010
        %00100100
        %00011000
        %00011000
        %00111100
        %01000010
        %10011001
        %10011001
        %11000011
        %11111111
        %01111110
        %00111100
end

 player1:
        %00000000
        %00000000
        %00000000
        %10000001
        %01000010
        %00100100
        %00011000
        %00011000
        %00111100
        %01000010
        %10011001
        %10011001
        %11000011
        %11111111
        %01111110
        %00111100
end

 COLUPF=$D4


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


 currentpaddle = 0
 drawscreen
 missile1x = 2 * paddle + 1 : if missile1x > 135 then missile1x = 135 : if missile1x<10 then missile1x=10

 rem increases parachute speed
 if a=0 then _P0_U_D=_P0_U_D+0.25
 if a=0 then _P1_U_D=_P1_U_D+0.25

 if a=1 then _P0_U_D=_P0_U_D+0.30
 if a=1 then _P1_U_D=_P1_U_D+0.30

 if a=2 then _P0_U_D=_P0_U_D+0.35
 if a=2 then _P1_U_D=_P1_U_D+0.35

 if a=3 then _P0_U_D=_P0_U_D+0.40
 if a=3 then _P1_U_D=_P1_U_D+0.40

 if a=4 then _P0_U_D=_P0_U_D+0.45
 if a=4 then _P1_U_D=_P1_U_D+0.45

 if a=5 then _P0_U_D=_P0_U_D+0.50
 if a=5 then _P1_U_D=_P1_U_D+0.50

 if b=5 then a=a+1 : b=0

 if collision(player0,missile1) && joy0fire then score=score+1 : player0y=255 : b=b+1
 if player0y=255 then player0x=rand : player0y=0
 if player0x<10 then player0y=255
 if player0x>135 then player0y=255

 if collision(player1,missile1) && joy0fire then score=score+1 : player1y=255 : b=b+1
 if player1y=255 then player1x=rand : player1y=0
 if player1x<10 then player1y=255
 if player1x>135 then player1y=255

 rem temporary solution since I dont have a gameover screen yet
 if collision(player0,playfield) then reboot
 if collision(player1,playfield) then reboot

  goto main


Link to comment
Share on other sites

Yeah I looked them over, and as far as I see I've set things up like in the examples. I also tried playing the example games in Stella and I could not get paddle controls to work with them either so it must be something wrong with Stella. I tried setting up the controllers like your page said. I'm using version 4.2 of Stella.

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...