` Started on Monday, August 9 2010

` 7:47 PM | Eastern Standard Time | by Zab

` Logo created by Zab

` Original name: MAXX Slice

` Coded in DarkBASIC Pro

` Plugins used: -

` Feel free to edit the code (But please give me credit where it's due) in other words DON'T LEECH!!!


sync rate 32


` Initial Variables

playing# = 0  `when it equals zero the player is in the menu when it equals one the player is playing the game

hp# = 0 `the hp of the player

lives# = 0 `if it equals -1 then the player loses

shooting# = 0 `if it equals 1 the player is shooting

reload# = 0 `if it equals 1 the player is reloading and cannot shoot

state# = 1 `gives the rotating effect to the logo

spawn# = 1

x# = 10  `The X Pos of the player

y# = 300 `The Y Pos of the player

image# = 2 `The image of the player

switch# = 1 `Switches the appearence of the moving player (RIGHT)

switch2# = 1 `Switches the appearence of the moving player (LEFT)

time# = 0 `Decides if the ticker has ticked and 500 millaseconds have passed

tick# = 0

equipped$ = "pistol"

lr# = 2 `If equals 1 then he is facing left is 2 he is facing right (used to make the weapon face the right way)



`Inital image loading

load image "m\logo.png" , 1

load image "m\right1.png" , 2

load image "m\right2.png" , 3

load image "m\right3.png" , 4

load image "m\right4.png" , 5

load image "m\left1.png" , 6

load image "m\left2.png" , 7

load image "m\left3.png" , 8

load image "m\left4.png" , 9

load image "m\pistol.png" , 10

load image "m\ground.png" , 11

load image "m\pistol2.tga" , 12



do

cls




ink rgb(0,0,0),rgb(0,0,0)`Changes the color of the mouse coords to white

print mousex() `Shows the X coord of the mouse

print mousey() `Shows the Y coord of the mouse


   if playing# = 0 `the menu is showing

sprite 1 , 320 , 361 , 1 `loads the logo as a sprite

`w# = sprite width(1) / 2 Commands not needed anymore

`h# = sprite width(1) / 2 Commands not needed anymore

offset sprite 1,88,54 `Makes the logo rotate from the center

rotate sprite 1,state# `Rotates the images


state# = state# + 2


   if state# > 360 `Once the image is done rotating once it resets back to 1

   state# = 1

   endif



   ink rgb(255,255,255),rgb(255,255,255) `Makes the first box white

   box 265,142,365,162

   ink rgb(0,0,0),rgb(0,0,0) `Makes the second box black

   box 268,145,362,159


      if mousex() > 265 and mousey() > 142 and mousex() < 365 and mousey() < 162

      ink rgb(255,0,0),rgb(255,0,0) `changes the text to red if the mouse hovers over the button


         if mouseclick() = 1

         playing# = 1

         endif


      else

      ink rgb(255,255,255),rgb(255,255,255)`Makes the text white

      endif


   text 294,146,"Play"




   endif `end of the menu code





   if playing# = 1 `The player clicked play (start of the gameplay)

   tick# = tick# + .5

   paste image 11,0,-335 `The ground


   hide sprite 1 `Hides the logo

   sprite 2 , x# , y# , image# `Creates the player

      ink rgb(0,0,0),rgb(0,0,0)`Changes the color of the mouse coords to white

      print mousex() `Shows the X coord of the mouse

      print mousey() `Shows the Y coord of the mouse



      if rightkey() = 1 `Moves the player right

      x# = x# + 4

      lr# = 2


if tick# > 2

time# = 1

tick# = 0

endif


   if switch# = 1

   image# = 2

      if time# = 1

      switch# = 2

      time# = 0

      endif

   endif


   if switch# = 2

   image# = 3

      if time# = 1

      switch# = 3

      time# = 1

      endif

   endif


   if switch# = 3

   image# = 4

      if time# = 1

      switch# = 4

      time# = 1

      endif

   endif


   if switch# = 4

   image# = 5

      if time# = 1

      switch# = 1

      time# = 0

      endif

   endif



      endif





   if x# > 1

      if leftkey() = 1  `Moves the player left

      x# = x# - 4



if tick# > 2

time2# = 1

tick# = 0

endif


   if switch2# = 1

   image# = 6

      if time2# = 1

      switch2# = 2

      time2# = 0

      endif

   endif


   if switch2# = 2

   image# = 7

      if time2# = 1

      switch2# = 3

      time2# = 1

      endif

   endif


   if switch2# = 3

   image# = 8

      if time2# = 1

      switch2# = 4

      time2# = 1

      endif

   endif


   if switch2# = 4

   image# = 9

      if time2# = 1

      switch2# = 1

      time2# = 0

      endif

   endif





      endif `End of moving left

   endif


print image#



if lr# > 0


      if equipped$ = "pistol" and lr# = 2

      sprite 3 , x#+30 , y#+20 , 10 `The pistol

      show sprite 3

      offset sprite 3 , 27 , 0

      else

         if sprite exist(3)

         hide sprite 3

         endif

      endif


      if equipped$ = "pistol" and lr# = 1

      sprite 4 , x#-31 , y#+20 , 12 `The pistol

      show sprite 4

      offset sprite 3 , 27 , 0

      else

            if sprite exist(4)

            hide sprite 4

            endif

      endif


endif



   endif `The end of the gameplay code













loop