Well im making a pong game, im trying not to use the tutorials too much, but when it came to limiting movement I had to look. I tried changing the "z" value to something like p1pos# , and then in the if upkey()=1 and p1pos#>-10: move sprite 1,10 ...something like that, but it doesn't want to work for me =\ Can anyone help?
Rem Project: Pong REMIX
Rem Created: Thursday, January 08, 2009
Rem ***** Main Source File *****
Rem From TDK_Man's Tutorial On Menu Screens
Set Display Mode 800,600,32
Sync On: Sync Rate 60
GLOBAL CurDir$
GLOBAL Mx=MouseX()
GLOBAL My=MouseY()
GLOBAL Mc=MouseClick()
cd "Media"
LOAD IMAGE "MainMenu.jpg",1
LOAD IMAGE "StartButton.jpg",2
LOAD IMAGE "StartButton2.jpg",3
LOAD IMAGE "Hi-ScoreButton.jpg",4
LOAD IMAGE "Hi-ScoreButton2.jpg",5
LOAD IMAGE "ExitButton.jpg",6
LOAD IMAGE "ExitButton2.jpg",7
LOAD IMAGE "PongBack.jpg",8
LOAD OBJECT "Paddle.3ds",10
LOAD OBJECT "Paddle.3ds",11
MainMenu:
cls
Paste Image 1,0,0
Paste Image 2,245,186
Paste Image 4,245,338
Paste Image 6,245,490
Rem Main Menu (Highlighted Buttons)
Do
`check mouse position/click on each loop
Mx=MouseX()
My=MouseY()
Mc=MouseClick()
Rem Start Button
If Mx > 245 and My > 186 And Mx < 566 And My < 242
PASTE IMAGE 3,245,186
If Mc=1 then gosub MainGame
ELSE
PASTE IMAGE 2,245,186
Endif
Rem Hi-Score Button
If Mx > 245 and My > 338 And Mx < 566 And My < 394
PASTE IMAGE 5,245,338
ELSE
PASTE IMAGE 4,245,338
Endif
Rem Exit Button
If Mx > 245 and My > 490 And Mx < 566 And My < 546
PASTE IMAGE 7,245,490
If Mc=1 then end
ELSE
PASTE IMAGE 6,245,490
Endif
Sync
Loop
MainGame:
cls
autocam off
position camera 0,0,30,30
point camera 0,0,0
sync on
sync rate 60
rem make "bumpers"
POSITION OBJECT 10,13,0,0
SCALE OBJECT 10,1000,1000,1000
POSITION OBJECT 11,-13,0,0
SCALE OBJECT 11,1000,1000,1000
rem make ball
make object sphere 3,1
color object 3, rgb (255,255,255)
rem make floor
make object box 4,30,0.1,30
position object 4,0,-0.55,0
rotate object 4,0,180,0
Texture Object 4, 8
CAMANGLEY=0
do
rem Player 1 movements
if keystate(17)=1
MOVE OBJECT 10,1
endif
if keystate(31)=1
MOVE OBJECT 10,-1
endif
rem Player 2 Movements
if upkey()=1
MOVE OBJECT 11,0.5
endif
if downkey()=1
MOVE OBJECT 11,-0.5
sync
loop
One other question, how can i set my background in the main menu back to the original, because ever since i loaded the paddle it changed to a picture of the paddle.
Thanks in advance.
Media is attached..
Be patient....everything takes time.