Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Mar 21st, 2010 | Syntax: None | Size: 13.14 KB | Hits: 101 | Expires: Never
Copy text to clipboard
  1. Rem * Title  : carbonade
  2. Rem * Author : mike kunak
  3. Rem * Date   : today
  4. REM *****************************************
  5. RemStart
  6.     *** TITLE - Carbonade - Fetch the Fruit
  7.     *** VERSION - 1.0.0 LAST UPDATED - 5.13.2004
  8.     *** DEVELOPER - Jason Holm
  9.     *** COPYRIGHT - Ingenious Student Labs
  10.     *** DATE CREATED - 5.11.2004
  11.     ***
  12. RemEnd
  13. REM *** START SYSTEM SETUP SECTION
  14.  
  15. sync on : sync rate 60
  16. autocam off
  17. hide mouse
  18. randomize timer()
  19.  
  20. REM *** STOP SYSTEM SETUP SECTION
  21. REM *****************************************
  22.  
  23. REM *****************************************
  24. REM *** START INTRO SECTION
  25. REM *** INTRO SECTION HEADER
  26.  
  27. REM DECLARE VARIABLES
  28. REM SCREEN DISPLAY
  29. cls 0
  30. load bitmap "images/carbonade-splash_template.bmp"
  31. ink rgb(0,0,0),0 : set text font "arial" : set text size 16 : set text to bold : set text transparent
  32. center text 320,420,"Developed by Jason Holm and Mike Kunak"
  33. center text 320,434,"Copyright (c) 2004 Ingenious Student Labs"
  34.  
  35. REM LOAD SOUNDS
  36. Load sound "sounds/carbonade-music_loop.wav",1 : set sound volume 1,50
  37. Load sound "sounds/carbonade-music_end.wav",2 : set sound volume 2,50
  38. Load sound "sounds/carbonade-game_start.wav",3 : set sound volume 3,50
  39. Load sound "sounds/carbonade-fruit_little.wav",4 : set sound volume 4,50
  40. Load sound "sounds/carbonade-fruit_super.wav",5 : set sound volume 4,50
  41. Load sound "sounds/carbonade-jump.wav",6 : set sound volume 2,50
  42. REM SOUND EFFECTS
  43. loop sound 1
  44. REM SPECIAL EFFECTS
  45. REM REFRESH SCREEN
  46. sync
  47.  
  48. REM *** INTRO SECTION LOOP
  49.  
  50. do
  51.    REM SCREEN DISPLAY
  52.    REM CONTROL INPUT
  53.    if Keystate(scancode())=1 then goto OptionsSection
  54.    REM REFRESH SCREEN
  55.    sync
  56. loop
  57.  
  58. REM *** END INTRO SECTION
  59. REM *****************************************
  60.  
  61. REM *****************************************
  62. REM *** START OPTIONS SECTION
  63. REM *** OPTIONS SECTION HEADER
  64.  
  65. OptionsSection:
  66. REM DECLARE VARIABLES
  67. REM SCREEN DISPLAY
  68. REM SOUND EFFECTS
  69. REM SPECIAL EFFECTS
  70. REM REFRESH SCREEN
  71.  
  72. REM *** OPTIONS SECTION LOOP
  73.  
  74.    REM CONTROL INPUT
  75.    REM REFRESH SCREEN
  76.  
  77. REM *** END OPTIONS SECTION
  78. REM *****************************************
  79.  
  80. REM *****************************************
  81. REM *** START MAIN SECTION
  82. REM *** MAIN SECTION HEADER
  83.  
  84. MainSection:
  85. REM DECLARE VARIABLES
  86. MyTimer = 1500 : rem MyTimer / sync rate = seconds on timer (approx.)
  87. Gravity# = 1 : rem How powerful gravity is
  88. MyPower = 13 : rem How strong the player can jump
  89. MySpeed = 15 : rem How fast the player can run
  90.  
  91.  
  92.  
  93. MyScore = 0 : rem Starting score is 0
  94. MyAcceleration# = 40.0 : rem Start without jumping or falling
  95.  
  96. REM SCREEN DISPLAY
  97. cls 0 : backdrop on
  98.  
  99. REM LOAD IMAGES
  100. Load image "images/carbonade-can_label.bmp",1
  101. Load image "images/carbonade-wall.bmp",2
  102. Load image "images/carbonade-wall.bmp",3
  103. Load image "images/carbonade-wall.bmp",4
  104. Load image "images/carbonade-wall.bmp",5
  105. Load image "images/carbonade-can_lid.bmp",99
  106. Load image "images/carbonade-superfruit.bmp",100
  107.  
  108. rem create a floor texture
  109. create bitmap 6,32,32
  110.    cls rgb(0,155,0)
  111.    ink rgb(0,145,0),0
  112.    box 4,4,12,12
  113.    get image 6,0,0,32,32
  114. delete bitmap 6
  115.  
  116. REM OBJECT CREATION
  117.  
  118. Rem Player Character
  119. make object cylinder 1,50
  120. scale object 1,100,140,100
  121. texture object 1,1
  122. position object 1,0,35,0
  123. make object collision box 1,-25,-35,-25,25,35,25,0
  124.  
  125. make object cylinder 99,50
  126.  
  127. make mesh from object 1,99
  128. delete object 99
  129.  
  130. add limb 1,1,1
  131. offset limb 1,1,0,25,0
  132. scale limb 1,1,100,1,100
  133. texture limb 1,1,99
  134.  
  135. rem Walls
  136.  
  137.    rem North Wall
  138.    make object box 2,2000,1000,10
  139.    rotate object 2,0,0,0
  140.    position object 2, 0,500,1005
  141.    texture object 2,2
  142.  
  143.    rem East Wall
  144.    make object box 3,2000,1000,10
  145.    rotate object 3,0,90,0
  146.    position object 3, 1005,500,0
  147.    texture object 3,3
  148.  
  149.    rem North Wall
  150.    make object box 4,2000,1000,10
  151.    rotate object 4,0,180,0
  152.    position object 4, 0,500,-1005
  153.    texture object 4,4
  154.  
  155.    rem West Wall
  156.    make object box 5,2000,1000,10
  157.    rotate object 5,0,270,0
  158.    position object 5, -1005,500,0
  159.    texture object 5,5
  160.  
  161. rem Floor
  162. make object box 6,2000,1000,2000 : position object 6,0,-500,0 : color object 6,rgb(0,255,0)
  163. make object collision box 6,-1000,-500,-1000,1000,500,1000,0
  164. texture object 6,6 : scale object texture 6,50,50
  165.  
  166. rem Steps
  167. for t=0 to 7
  168.    make object box t+7,50,10,50
  169.    position object t+7,0,5+(t*20),100+(t*100)
  170.    color object t+7,rgb(100,200,100)
  171.    make object collision box t+7,-25,-5,-25,25,5,25,0
  172. next t
  173.  
  174. rem Fruits
  175. NumberOfFruits = 30
  176. FruitColor = 0
  177. for t = 1 to NumberOfFruits
  178.  
  179.    if FruitColor = 0
  180.       r = 255 : g = 0
  181.    endif
  182.    if FruitColor = 1
  183.       r = 255 : g = 255
  184.    endif
  185.    if FruitColor = 2
  186.       r = 0 : g = 255
  187.    endif
  188.    if FruitColor = 3
  189.       r = 255 : g = 125
  190.    endif
  191.    FruitColor = FruitColor + 1
  192.    if FruitColor = 4 then FruitColor = 0
  193.  
  194.    make object sphere t + NumberOfFruits ,50
  195.    color object t + NumberOfFruits , rgb(r,g,0)
  196.    position object t + NumberOfFruits ,Rnd(1900)-950,30,Rnd(1900)-950
  197.    make object collision box t + NumberOfFruits ,-25,-25,-25,25,25,25,0
  198. next t
  199.  
  200. rem Super Fruit
  201.    make object sphere 100,100
  202.    texture object 100,100
  203.    position object 100 ,0,180,725
  204.    make object collision box 100,-50,-50,-50,50,50,50,0
  205.  
  206. REM LOAD MODELS
  207. REM SET COLLISIONS
  208. REM SET CAMERA
  209. REM SOUND EFFECTS
  210. play sound 3
  211. REM SPECIAL EFFECTS
  212. REM REFRESH SCREEN
  213. sync
  214.  
  215. REM *** MAIN SECTION LOOP
  216. do
  217.    if scancode()=0 then exit
  218. loop
  219. do
  220.    REM SPECIAL EFFECTS
  221.    REM OBJECT ORIENTATIONS
  222.    1pX# = object position X(1)
  223.    1pY# = object position Y(1)
  224.    1pZ# = object position Z(1)
  225.    1aX = object angle X(1)
  226.    1aY = object angle Y(1)
  227.    1aZ = object angle Z(1)
  228.    REM CAMERA ORIENTATIONS
  229.    cpX# = camera position X()
  230.    cpY# = camera position Y()
  231.    cpZ# = camera position Z()
  232.    caX# = camera angle X()
  233.    caY# = camera angle Y()
  234.    caZ# = camera angle Z()
  235.    REM LIVE SCREEN DISPLAY
  236.    ink rgb(255,255,255),0 : set text size 16 : set text to bold : set text transparent
  237.    center text 320,420,"USE ARROW KEYS TO MOVE   |   PRESS SPACE BAR TO JUMP"
  238.    center text 320,440,"PRESS 'Q' TO QUIT"
  239.    set cursor 0,0
  240.    print "Seconds Left: ";(MyTimer/60)+1
  241.       Rem at 60 frames a second, every timer countdown is 1/60th of a second,
  242.       Rem so this will display the time left as whole seconds
  243.    set cursor 0,20
  244.    print "SCORE: ";MyScore
  245.  
  246.    REM CONTROL INPUT
  247.  
  248.    if Spacekey()=1 and MyAcceleration# = 0.0 : rem Make sure I've fully landed before I can jump again
  249.       1pY# = 1pY# - Gravity# : rem Look below me
  250.       position object 1, 1pX#,1pY#,1pZ# : rem Feel below me
  251.       for t = 6 to 12
  252.          if object collision(1,t)>0 : rem If feel a solid object below me
  253.             MyAcceleration# = MyPower : rem Prepare to jump!
  254.             play sound 6
  255.          endif
  256.       next t
  257.       1pY# = 1pY# + Gravity# : rem Look up
  258.       position object 1, 1pX#,1pY#,1pZ# : rem Move back
  259.    endif
  260.  
  261.    if Upkey()=1 then move object 1,MySpeed
  262.    if Downkey()=1 then move object 1,0-MySpeed
  263.    if Leftkey()=1 then 1aY = wrapvalue(1aY-(MySpeed/3))
  264.    if Rightkey()=1 then 1aY = wrapvalue(1aY+(MySpeed/3))
  265.  
  266.    if Inkey$()="q"
  267.       for x = 1 to 100
  268.          if object exist(x) = 1 then delete object x
  269.       next x
  270.       backdrop off
  271.       goto EndSection
  272.    endif
  273.    REM TRANSFORM OBJECTS
  274.    REM MOVE OBJECTS
  275.    Yrotate object 1,1aY
  276.  
  277.    REM CHECK FOR COLLISION
  278.    rem Now that I've moved, record the new position
  279.    1pXcol# = object position X(1)
  280.    1pZcol# = object position Z(1)
  281.  
  282.    Rem Arena Collision - Keep the player inside the walls
  283.  
  284.       if 1pXcol#<-975 then 1pXcol#=-975 : rem If I try to pass through the west wall, find the place I should stay
  285.       if 1pZcol#<-975 then 1pZcol#=-975 : rem If I try to pass through the south wall, find the place I should stay
  286.       if 1pXcol#>975 then 1pXcol#=975 : rem If I try to pass through the east wall, find the place I should stay
  287.       if 1pZcol#>975 then 1pZcol#=975 : rem If I try to pass through the north wall, find the place I should stay
  288.  
  289.    Rem Steps Collision
  290.  
  291.       StepsHit = 0 : rem Get ready to start checking collisions
  292.       for CheckStep = 7 to 12 : rem Check all 7 step objects one at a time
  293.          if object collision(1,CheckStep)>0 : rem If I'm touching the object I'm currently checking
  294.             StepsHit = StepsHit + 1 : rem Mark me up for a collision
  295.          endif
  296.       next t : rem Check next step object
  297.  
  298.    Rem Reset Collision Positions
  299.  
  300.       if StepsHit > 0 : rem If I hit any steps
  301.          position object 1, 1pX#,1pY#,1pZ# : rem Put me back where I was
  302.       else : rem If I'm not hitting a step, I might be hitting a wall
  303.          position object 1, 1pXcol#,1pY#,1pZcol# : rem Keep me inside the walls - just in case
  304.          1pX# = 1pXcol# : 1pZ# = 1pZcol# : rem Reset collision variables
  305.       endif
  306.  
  307.       1aY# = object angle Y(1) : rem Record the angle I'm facing
  308.  
  309.    Rem Gravity Effects
  310.  
  311.       if MyAcceleration# = 0.0 : rem If I'm not moving up or down
  312.          EmptySpace = 0 : ObjectsChecked = 0 : rem Get ready to start checking collisions
  313.          for CheckObject = 6 to 12 : rem Check the floor and every step object
  314.             if object collision(1,CheckObject)>0 : rem If I'm touching something
  315.                1pY# = 1pY# - Gravity# : rem Look below me
  316.                position object 1, 1pX#,1pY#,1pZ# : rem Feel below me
  317.                if object collision(1,CheckObject) = 0 : rem If I feel only air
  318.                   EmptySpace = EmptySpace + 1 : rem Mark up a free space
  319.                endif : rem I'm touching something, but it's not below me
  320.                1pY# = 1pY# + Gravity# : rem Look up
  321.                position object 1, 1pX#,1pY#,1pZ# : rem Move back
  322.             else : rem If I'm not touching anything
  323.                EmptySpace = EmptySpace + 1 : rem rem Mark up a free space
  324.             endif
  325.             ObjectsChecked = ObjectsChecked + 1 : rem Done with that one!
  326.          next CheckObject : rem On to the next one!
  327.          if EmptySpace = ObjectsChecked : rem If I've checked all the objects and nothing is below me
  328.             MyAcceleration# = MyAcceleration# - Gravity# : rem Gravity begins to pull
  329.          endif
  330.       endif
  331.  
  332.       if MyAcceleration# <> 0.0 : rem If I'm moving
  333.          1pY# = 1pY# + MyAcceleration# : rem Find where I'm going
  334.          position object 1, 1pX#,1pY#,1pZ# : rem Put me there
  335.          EmptySpace = 0 : ObjectsChecked = 0 : rem Get ready to start checking collisions
  336.          for CheckObject = 6 to 12 : rem Check the floor and every step object
  337.             if object collision(1,CheckObject)>0 : rem If I hit an object
  338.                1pY# = 1pY# - MyAcceleration# : rem Find where I was
  339.                position object 1, 1pX#,1pY#,1pZ# : rem Put me back
  340.                MyAcceleration# = 0.0 : rem Stop me from moving
  341.             else : rem If the space I'm going to is just air
  342.                EmptySpace = EmptySpace + 1 : rem rem Mark up a free space
  343.             endif
  344.             ObjectsChecked = ObjectsChecked + 1 : rem Done with that one!
  345.          next CheckObject : rem On to the next one!
  346.          if EmptySpace = ObjectsChecked : rem If I've checked all the objects and nothing is in my path
  347.             MyAcceleration# = MyAcceleration# - Gravity# : rem Gravity pulls more
  348.          endif
  349.       endif
  350.  
  351.    Rem Sphere Collision
  352.  
  353.       for t = 1 to NumberOfFruits : rem If I hit one of the little fruits
  354.          if Object collision(1,t + NumberOfFruits)>0
  355.             play sound 4
  356.             delete object t + NumberOfFruits
  357.             MyScore = MyScore + 100 : rem How many points each little fruit is worth
  358.          endIf
  359.       next t
  360.  
  361.       If Object collision(1,100)>0 : rem If I hit the super fruit
  362.          play sound 5
  363.          delete object 100
  364.          MyScore = MyScore + 1000 : rem How many points the super fruit is worth
  365.       endIf
  366.  
  367.    REM MOVE CAMERA
  368.    cpZ# = Newzvalue(1pZ#,1aY-180,200)
  369.    cpX# = Newxvalue(1pX#,1aY-180,200)
  370.    if cpX#<-999 then cpX#=-999
  371.    if cpZ#<-999 then cpZ#=-999
  372.    if cpX#>999 then cpX#=999
  373.    if cpZ#>999 then cpZ#=999
  374.    Position camera cpX#,1pY#+65,cpZ#
  375.    Point camera 1pX#,1pY#+35,1pZ#
  376.    REM REFRESH SCREEN
  377.    sync
  378.  
  379.    rem Check Timer
  380.    if MyTimer = 0 : rem If the game is over
  381.       for x = 1 to 100 : rem Check all the game object
  382.          if object exist(x) = 1 then delete object x
  383.       next x
  384.       backdrop off
  385.       goto EndSection
  386.    endif
  387.    if MyTimer > 0 then MyTimer = MyTimer - 1 : rem Timer countdown
  388.  
  389. loop
  390.  
  391. REM *** STOP MAIN SECTION
  392. REM *****************************************
  393.  
  394. REM *****************************************
  395. REM *** START END SECTION
  396. REM *** END SECTION HEADER
  397.  
  398. EndSection:
  399. REM DECLARE VARIABLES
  400. REM SCREEN DISPLAY
  401. cls 0
  402. center text 320,200,"YOUR SCORE: "+str$(MyScore)
  403. center text 320,240,"PLAY AGAIN [Y/N]?"
  404. REM SOUND EFFECTS
  405. stop sound 1
  406. play sound 2
  407. REM SPECIAL EFFECTS
  408. REM REFRESH SCREEN
  409. sync
  410.  
  411. REM *** END SECTION LOOP
  412. do
  413.    if scancode()=0 then exit
  414. loop
  415. do
  416.    REM CONTROL INPUT
  417.    if Inkey$()="y"
  418.       loop sound 1
  419.       goto OptionsSection
  420.    endif
  421.  
  422.    if Inkey$()="n"
  423.       cls : end
  424.    endif
  425.    REM REFRESH SCREEN
  426.    sync
  427. loop
  428.  
  429. end
  430. REM *** STOP END SECTION
  431. REM *****************************************