Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / EXE won't work!

Author
Message
MoNkEyMaN
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: United Kingdom
Posted: 8th Feb 2003 01:27
I've just finished making my first game, (yes i am a newbie)but whenever i make the game into and exe and run it, it doesn't work.

Please help!

Rem Hide the mouse, put manual sync on and set sync rate
Hide Mouse
Sync On
Sync Rate 60

Rem Load the music and loop it to play non-stop
Load Music "Hidden Fury.mid",1
Loop Music 1



Repeat
repeat
Rem Draw the main menu
Load Image "title.bmp",10
Paste Image 10,260,20
Center Text 320,300, "Type 1 and press enter for One Player!"
Center Text 320,315, "Type 2 and press enter for Two Player!"
Center Text 320,450, "Press Space to exit"
Set Cursor 320,240

Load Image "menupic.bmp",1
Paste Image 1,260,100

sync

Rem Repeat until choice is made (1 or 2 player)
choice$=inkey$()
until choice$="1" or choice$="2" or choice$=" "

Rem Clear the screen
cls


If choice$ = "1" then Gosub OnePlayer
If choice$ = "2" then Gosub TwoPlayer

Until choice$ = " "
end

Rem Variable Initialisation
InitialiseForPlay:
radius# = 3.0
score = 0
secondscore = 0
secondpspeed = 8
ballxpos = 320
ballypos = 240
ballyspeed = Rnd(2)+ 1
ballxspeed = 5
secondxpos = 530
secondypos = 240
lives = 3
secondlives = 3
return

Oneplayer:
gosub InitialiseForPlay

Rem Create a new bitmap and draw a line (the paddle), get the image of the line and change back to first bitmap
Create bitmap 1,25,25
Line 1,1,1,21
Get Image 1,1,1,2,22
Set Current Bitmap 0

Rem Create a new bitmap and draw a circle (the ball), get the image of the circle and change back to first bitmap
Create Bitmap 2,25,25
Circle 5,5,radius#
Get Image 2,1,1,10,10
Set Current Bitmap 0

Do

Rem Clear the screen and draw the score
Cls
Text 0,0,"Score:"+str$(score)
Text 0,15,"Lives:"+str$(lives)

Rem Paste the title on-screen
Paste Image 10,260,20


Rem Draw the box in which the game is played
Line 98,98,542,98
Line 542,98,542,382
Line 542,382,98,382
Line 98,382,98,98


Rem Draw the paddle to the screen
Sprite 1,xpos,ypos,1

Rem Set up the position and control of the paddle
ypos = MouseY()
xpos = 110

Rem Set up collision for paddle
If ypos 360 then ypos = 360

Rem Draw the ball
Sprite 2,ballxpos,ballypos,2

Rem Start the ball moving
ballxpos = ballxpos + ballxspeed
ballypos = ballypos + ballyspeed

Rem Check collision for the ball against the walls and reverse the speed accordingly
If ballxpos > 534 then ballxspeed = ballxspeed * -1
If ballxpos = 100
ballxspeed = ballxspeed * -1
lives = lives - 1
ballxpos = 320
ballypos = 240
Wait 2000
Endif
If ballypos 374 then ballyspeed = ballyspeed * -1

Rem Check for collision of the ball against the paddle and reverse speed accordingly
if ballxpos xpos - 6 and ballypos ypos - 20
ballxspeed = ballxspeed * -1
score = score + 1
Endif

Rem Check if score is equal or above 50
If score >= 50
Rem Clear the screen, delete sprites, display message and return to main menu
Cls
Delete Sprite 1
Delete Sprite 2
center text 320,240,"You win with "+str$(score)+" points!"
Wait 2000
Cls
return
Endif

Rem Check if lives falls below 0
If lives 360 then ypos = 360
If secondypos 360 then secondypos = 360

Rem Draw the ball
Sprite 2,ballxpos,ballypos,2

Rem Start the ball moving
ballxpos = ballxpos - ballxspeed
ballypos = ballypos + ballyspeed

Rem Check collision for the ball against the walls and reverse the speed accordingly
If ballxpos >= 534
ballxspeed = ballxspeed * -1
secondlives = secondlives - 1
ballxpos = 320
ballypos = 240
Wait 2000
Endif
If ballxpos = 100
ballxspeed = ballxspeed * -1
lives = lives - 1
ballxpos = 320
ballypos = 240
Wait 2000
Endif
If ballypos 374 then ballyspeed = ballyspeed * -1


Rem Check for collision of the ball against player one's paddle and reverse speed accordingly
If ballxpos xpos - 20 and ballypos ypos - 20
ballxspeed = ballxspeed * -1
score = score + 1
Endif

Rem Check for collision of the ball against player two's paddle and reverse speed accordingly
If ballxpos > secondxpos - 12 and ballxpos secondypos - 20 and ballypos = 50
Rem Clear the screen, delete sprites, display message and return to main menu
Cls
Delete Sprite 1
Delete Sprite 2
Delete Sprite 3
center text 320,240,"Player 1 wins with "+str$(score)+" points!"
Wait 2000
Cls
return
Endif


Rem Check if player two's score is equal or above 50
If secondscore >= 50
Rem Clear the screen, delete sprites, display message and return to main menu
Cls
Delete Sprite 1
Delete Sprite 2
Delete Sprite 3
center text 320,240,"Player 2 wins with "+str$(score)+" points!"
Wait 2000
Cls
return
Endif

Rem Check if player one's lives falls below 0
If lives
MnKMaN
MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 8th Feb 2003 01:37
Not quite complete, I'm afraid - any place we can download the files from ?

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
MoNkEyMaN
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: United Kingdom
Posted: 8th Feb 2003 03:24
Site should be up by tomorrow check back then 8)

MnKMaN
soap_shoes
21
Years of Service
User Offline
Joined: 22nd Dec 2002
Location: United States
Posted: 8th Feb 2003 05:50
nonono..
you see...your not the noob....
yesterday i learned how to move sprites LMAO

Do not give up for the beginning
is always the hardest...........
MoNkEyMaN
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: United Kingdom
Posted: 9th Feb 2003 00:05
Site is up 8)
Go to http://frostbp.tripod.com/index.htm
to download my first game pong!

(And also please see if it will work as an exe cause it won't for me)

MnKMaN

Login to post a reply

Server time is: 2024-11-24 02:02:37
Your offset time is: 2024-11-24 02:02:37