hi
me and my buddys have a school task, where we are going to create a couple of games, but none of understand how we should make the menu work, like if i press spacekey on play, the game should begin, can someone help me out with the code?
here is the menu code
rem Menu
Rem ***** Main Source File *****
set display mode 1024,768,32
sync on
sync rate 100
Menu()
start = 0
while start=0
rem print "mousex: ";mousex()
rem print "mousey: ";mousey()
if upkey()=1 then sel=1
if downkey()=1 then sel=2
if sel=1
paste image 3,290,330
paste image 2,290,458
endif
if sel=2
paste image 1,290,458
paste image 4,290,330
endif
and here is the entire code for the game
Rem Project: uberSUPERGAME
Rem Created: 01.11.2006 12:24:49
Rem ***** Main Source File *****
sync on
sync rate 100
hide mouse
autocam off
set display mode 1024,768,32
color backdrop rgb(0,0,0)
red = rgb(255,0,0)
blue = rgb(0,0,255)
rem sound
rem load sound "sounds\sound.mid",1
rem loop sound 1
rem make player 1
smiley=10
load image "smiley.jpg",smiley
beep=21
load sound "nicebeep.wav", beep
player = 1
make object box player,15,5,5
color object player,blue
position object player,0,0,80
rem make player 2
enemy = 2
make object box enemy,15,5,5
color object enemy,blue
position object enemy,0,0,300
rem make ball
ball = 5
make object sphere ball, 8
texture object ball, smiley
position object ball, 0, 0, 160
fix object pivot ball
rem Set Camera stuff
rem normal z = -20
position camera 0,0,50,-20
rem point camera 0, object position x(player), 45,0
rem lage kanter og vegger
vegg1 = 3
vegg2 = 4
make object box vegg1, 5,5,400
color object vegg1,red
position object vegg1,80,0,200
make object box vegg2, 5,5,400
color object vegg2,red
position object vegg2,-80,0,200
rem SCOREZ OSV
player1score = 0
player2score = 0
thepoint = 0
hits = 0
rem show stats
white = rgb(255,255,255)
yrotate object ball,45
ballspeed = 1.0
rem ZE LOOP
do
ink white,0
set cursor 20,20
print "Fps: ";fps
print "Ball Angle Y: ";ballangle
print "P1 score: ";player1score
print "P2 score: ";player2score
print "Hits: ";hits
print "Ballspeed: ";ballspeed
ballangle = object angle y(ball)
fps = screen fps()
rem update vars
brikkeposisjon = object position x(player)
rem Movement
if leftkey()=1 then move object left player,1.5
if rightkey()=1 then move object right player,1.5
if spacekey()=1
ballspeed = 1.0
hits = 0
yrotate object ball,rnd(5)
endif
rem ball movement
if object position z(ball) > 310
player1score = player1score +1
position object ball,0,0,160
ballspeed = 0.0
hits = 0
thepoint = 1
endif
if object position z(ball) < 70
player2score = player2score +1
position object ball,0,0,160
ballspeed = 0.0
hits = 0
thepoint = 2
endif
if object collision(ball,player)=1
play sound beep
rem yrotate object ball,rnd(20)
yrotate object ball, 360-object angle y(ball)+180
if object angle y(ball) > 360 then yrotate object ball, object angle y(ball)-360
move object ball,1
hits = hits+1
position object ball,object position x(ball), 0, object position z(ball)+1
ballspeed = ballspeed+0.1
endif
rem Object Kollisjon BALL OG ENEMY
if object collision(ball,enemy)=1
play sound beep
yrotate object ball, 360-object angle y(ball)+180
if object angle y(ball) > 360 then yrotate object ball, object angle y(ball)-360
move object ball,1
hits = hits+1
rem OMFG OWNED BY EIRIK
endif
if object collision(ball,vegg1)=1
rem yrotate object ball, object angle y(ball)+(80+rnd(20))
yrotate object ball, 360-object angle y(ball)
endif
if object collision(ball,vegg2)=1
rem yrotate object ball, object angle y(ball)+90
rem yrotate object ball, object angle y(ball)+(80+rnd(20))
yrotate object ball, 360-object angle y(ball)
endif
rem if object angle y(ball) > 360 then yrotate object ball,object angle y(ball)-360
rem if object angle y(ball) < 0 then yrotate object ball, object angle y(ball)+360
rem l33t enemy AI
if object position x(ball) > object position x(enemy)
move object right enemy,1
endif
if object position x(ball) < object position x(enemy)
move object left enemy,1
endif
move object ball,ballspeed
rem ikke gå utenfor banen! FFFSSSS
if object position x(player) > 70 then position object player,68,0,80
if object position x(player) < -70 then position object player,-68,0,80
sync
loop
so if anyone could help me out with this so thanks
p.s. sry about my bad english XD