whoops forgott a bit of the code
rem setup
sync on
sync rate 35
hide mouse
rem placing the camera
make camera 1
position camera 1,0,0,0
color backdrop 1,RGB(0,0,0)
rem make the player
make object box 1,10,2,2
color object 1,RGB(255,255,0)
position object 1,0,-25,50
rem make ball
make object sphere 2,2
color object 2,RGB(0,255,0)
position object 2,0,-23,50
rem make the player move
do
if leftkey()=1 and object position x(1)>-30
move object left 1,1.5
if xvelocity#=0 then move object left 2,1.5
endif
if rightkey()=1 and object position x(1)<30
move object right 1,1.5
if xvelocity#=0 then move object right 2,1.5
endif
if keystate(57) and xvelocity#=0
xvelocity#=0.5
yvelocity#=0.5
endif
position object 2,object position x(2)+xvelocity#,object position y(2)+yvelocity#,object position z(2)
if object position x(2)<-35 or object position x(2)>35 then xvelocity#=0-xvelocity#
if object position y(2)>28 or object collision (1,2) then yvelocity#=0-yvelocity#
if object position y(2)<-30
xvelocity#=0
yvelocity#=0
position object 1,0,-25,50
position object 2,0,-23,50
endif
sync
loop
Maby the code is better now, the problems I have are:
How to make randomized levels
When I am loadingin the bitmaps the screen turn black
Can´t have the ball kill the boxes in the level
NOTE THAT:The things that is the problems is not within the codesnippet. For one and another reason.
You never fails, only make mistakes.