Hello all!
It's been a while since I've programmed
anything. It's good to be back though,lol.
Anyways...I'm currently working on a new game called "Struck Gold!", its like a crane/shooter game where the object is to pick up as many objects as possible in 60 sec. You can see this 20 line
version as a super beta of what is to come, although I had to take out most of the things due to space. But it is still fully playable.
To play press the spacekey to shoot the claw(represented by the rotating cube), and try to "grab" an object. Different objects have different values. Also, some objects are "heavier" than others.
The objective is to try and reach the level's pt goal...which increases with every level. Click
(Gold)Biggest Yellow Cube-500pts-Heaviest
(Gold)Big Yellow Cube-250pts-Heavy
(Gold)Medium Yellow Cube-100pts-light
(Gold)small yellow cube-50pts-lightest
(Rock)Large Brown Cube-20pts-Heaviest
(Rock)Small Brown Cube-11pts-Heavy
(Bones)Rectangular White Cube-7pts-lightest
(Skull)Small White Cube-20pts-Lightest
(Critter)Green Rect. Cube-2pts-Light-Moves around(disabled)
(TNT)Black Rect. Cube-1pt-No weight-Destroys objects around it(disabled)
(Grab Bag)Purply Cube-0>800pts-0>heaviest
[edit]hmm...its been awhile since i've done this...just click here for the source code
dim object_info(30,1) as float:dim claw_info(4) as float:global obj_col as integer:global score as integer:global goal as integer:global time as integer:global level as float:level = 1:global total_objects as integer:set display mode 1024,768,32:sync on
sync rate 60:autocam off:position camera 0,-10,-20:point camera 0,-10,0:hide mouse:randomize timer():make object cube 1,1:hide object 1:set object collision to boxes 1:make object cone 2,1:glue object to limb 2,1,0:set object collision off 2
zrotate object 2,180:move object up 2,.2:zrotate object 1,rnd(140)-70:load_level(1):do:if claw_info(4) = 0:zrotate object 1,object angle z(1)+claw_info(1)*claw_info(0):if object angle z(1) > 80:claw_info(0) = -1:endif:if object angle z(1) < -80
claw_info(0) = 1:endif:if spacekey() = 1:claw_info(4) = 1:endif:else:if claw_info(4) = 2:if obj_col > 2:move object up obj_col,claw_info(3)-object_info(obj_col-9,0)/5.5:move object up 1,claw_info(3)-object_info(obj_col-9,0)/5.5:else
move object up 1,claw_info(3)-.25:endif:if object position y(1) > 0:position object 1,0,0,0:claw_info(4) = 0:zrotate object 1,rnd(140)-70:if obj_col > 2:delete object obj_col:dec total_objects,1:inc score,object_info(obj_col-9,1):endif:endif:endif
if claw_info(4) = 1:move object down 1,claw_info(2):if object position x(1) < -15 or object position x(1) > 15 or object position y(1) < -22 or object collision(1,0) > 2:claw_info(4) = 2:obj_col = object collision(1,0):if obj_col > 2
zrotate object obj_col,object angle z(1):move object down 1,claw_info(2)/4:endif:endif:endif:endif:if 60-(timer()-time)/1000 < 0:if score => goal:inc level,1:load_level(level):else:backdrop off:cls:score = 0
input "You needed "+str$(goal-score)+" to win...would you like to play again?(Y/N)",temp$:if temp$="Y" or temp$="y":level=1:load_level(level):backdrop on:else:end:endif:endif:endif:text 1,1,"SCORE - "+str$(Score):text 1,15,"Goal - "+str$(Goal)
text 100,1,"Time - "+str$(60-(timer()-time)/1000):text 100,15,"Level - "+str$(level):sync:loop
function load_level(id)
if id = 1:claw_info(0) = rnd(1):if claw_info(0) = 0:claw_info(0) = -1:endif:claw_info(1) = 3.75:claw_info(2) = .25:claw_info(3) = .75:endif:for i = 1 to 30:if object exist(i+9):delete object i+9:endif:next i
open to read 1,"levels\"+str$(ID)+".txt":read string 1,objects$:total_objects = val(objects$):for i = 1 to val(objects$):read string 1,obj_id$:read string 1,obj_x$:read string 1,obj_y$:object_info(i,0) = val(obj_id$):make object cube i+9,1
if val(obj_id$)=1:scale object i+9,200,200,200:color object i+9,rgb(255,255,0):object_info(i,0)=4 : object_info(i,1) = 500:endif:if val(obj_id$)=2:scale object i+9,150,150,150:color object i+9,rgb(255,255,0):object_info(i,0)=3.75:object_info(i,1) = 250
endif:if val(obj_id$)=3:scale object i+9,100,100,100:color object i+9,rgb(255,255,0):object_info(i,0)=3.5 : object_info(i,1) = 100:endif:if val(obj_id$)=4:scale object i+9,50,50,50:color object i+9,rgb(255,255,0):object_info(i,0)=3.25:object_info(i,1)=50
endif:if val(obj_id$)=5:scale object i+9,150,150,150:color object i+9,rgb(100,25,0):object_info(i,0)=4 : object_info(i,1) = 20:endif:if val(obj_id$)=6:scale object i+9,100,100,100:color object i+9,rgb(100,25,0):object_info(i,0)=3.75:object_info(i,1)=11
endif:if val(obj_id$)=7:scale object i+9,50,100,100:color object i+9,rgb(255,255,255):object_info(i,0)=3.25 : object_info(i,1) = 7:endif:if val(obj_id$)=8:scale object i+9,100,100,100:color object i+9,rgb(255,255,255):object_info(i,0)=3.25
object_info(i,1)=20:endif:if val(obj_id$)=9:scale object i+9,200,100,100:color object i+9,rgb(0,255,0):object_info(i,0)=3.25 : object_info(i,1) = 2:endif:if val(obj_id$)=10:scale object i+9,150,200,150:color object i+9,rgb(0,0,0):object_info(i,0)=0
object_info(i,1) = 1:endif:if val(obj_id$)=11:scale object i+9,100,150,100:color object i+9,rgb(255,0,255):object_info(i,0)=rnd(4) : object_info(i,1) = rnd(800):endif:if val(obj_id$)=12:scale object i+9,50,50,50:color object i+9,rgb(255,255,255)
object_info(i,0)=3.25 : object_info(i,1) = 600:endif:position object i+9,val(obj_x$),val(obj_y$),0:next i:close file 1:time = timer():goal = 650*(level/2)+(level-1)*1000:if level=1:goal=650:endif
endfunction
Finally...make sure to download the levels and save them in the same directory as this program...