Hi, another mini game for you all.
The object of the game is to throw the hammer as far as possible.
controls:
press and hold left mouse button
move mouse to spin hammer (circular motion is best)
release left mouse button to throw
and throw to the right
a foul will be called if:
the end of the handle (the sphere) goes outside the right edge or upper edge of the red box
the throw lands to the left of the matrix
You might want to make sure your on the 640x480 resolution as this uses the mouse move commands so it may not play correctly if you're on a different resolution.
sync on : sync rate 60 : set window off : hide mouse : autocam off : set camera range 1,6000 : l# = 150 : m# = 1 : h_i# = 300 : s_i# = 1 : l_d# = 0.1 : a_d# = 1.0 : g# = 0.5 : pi# = 3.142 : best_throw = 0 : make object sphere 1, 30 : make object box 2, 10,l#,10 : offset limb 2,0,0,l#/-2,0 : make object box 3, 60,40,20 : make object plain 4, 500,500 : color object 4, rgb(255,0,0) : ghost object on 4 : position object 4, -250,250,0 : make matrix 1, 10000,3000,10,3 : position matrix 1, 0,0,-1500
throw = 0 : do : if throw = 0 : f_x# = 0 : f_y# = 0 : l_vel_x# = 0 : l_vel_y# = 0 : a_vel# = 0 : l_pos_x# = -1.5*l# : l_pos_y# = 1.5*l# : a_pos# = 0 : cam_pos_z# = -1000 : foul = 0 : endif : if throw < 2 : f_x# = mousemovex()*0.1 : f_y# = mousemovey()*0.1 : if mouseclick() = 1 : throw = 1 : l_acc_x# = (f_x# - l_d#*l_vel_x#) / m# : l_acc_y# = (-1*f_y# - l_d#*l_vel_y#) / m# : a_acc# = (f_y#*l#*sin(a_pos#) - f_x#*l#*cos(a_pos#) - m#*g#*l#*sin(a_pos#) - a_d#*a_vel#) / h_i# : l_vel_x# = l_vel_x# + l_acc_x# : l_vel_y# = l_vel_y# + l_acc_y#
a_vel# = a_vel# + a_acc# : l_pos_x# = l_pos_x# + l_vel_x# : l_pos_y# = l_pos_y# + l_vel_y# : a_pos# = wrapvalue(a_pos# + a_vel#) : endif : position object 1, l_pos_x#, l_pos_y#, 0 : zrotate object 1, a_pos#+180 : position object 2, object position x(1), object position y(1), object position z(1) : rotate object 2, object angle x(1), object angle y(1), object angle z(1) : move object up 2, l# : position object 3, object position x(1), object position y(1), object position z(1) : rotate object 3, object angle x(1), object angle y(1), object angle z(1) : move object up 3, l# : if l_pos_x# > 0 or l_pos_y# < 0 or l_pos_y# > 500 : foul = 1 : endif : cam_pos_x# = 0 : cam_aim_x# = 0 : cam_aim_y# = 0 : if throw = 1 : if mouseclick() = 0 : throw = 2 : t_pos_x# = object position x(3) : t_pos_y# = object position y(3) : t_vel# = (pi#*a_vel#*l#/180) : t_vel_x# = t_vel#*cos(a_pos#) : t_vel_y# = t_vel#*sin(a_pos#) : endif
endif : else : if t_pos_y# > 0 : t_vel_y# = t_vel_y# - g# : t_pos_x# = t_pos_x# + t_vel_x# : t_pos_y# = t_pos_y# + t_vel_y# : position object 2, t_pos_x#, t_pos_y#, 0 : roll object left 2, a_vel# : position object 3, t_pos_x#, t_pos_y#, 0 : roll object left 3, a_vel# : else : if t_pos_x# < 0 : foul = 1 : endif : position object 2, t_pos_x#, 0, 0 : position object 3, t_pos_x#, 0, 0 : if foul = 0 : center text screen width()/2,screen height()*0.25, "YOUR DISTANCE IS : " + str$(int(t_pos_x#)) : if int(t_pos_x#) > best_throw : center text screen width()/2,screen height()*0.3, "!!! NEW RECORD !!!" : endif : else : center text screen width()/2,screen height()*0.25, "FOUL THROW" : endif : center text screen width()/2,screen height()*0.75, "PRESS SPACE TO THROW AGAIN"
if spacekey() = 1 : throw = 0 : if int(t_pos_x#) > best_throw and foul = 0 : best_throw = int(t_pos_x#) : endif : endif : endif : cam_pos_x# = curvevalue(t_pos_x#,cam_pos_x#,60) : cam_aim_x# = curvevalue(t_pos_x#,cam_aim_x#,20) : cam_aim_y# = curvevalue(t_pos_y#,cam_aim_y#,20) : endif : position camera cam_pos_x#,100,-1000 : point camera cam_aim_x#, cam_aim_y#, 0 : set cursor 0,0 : print "CURRENT BEST THROW : ", best_throw : sync : loop
Enjoy.