Ok, I posted this in here because technically I am still a noob. Well IDK what is wrong with the code, it was working then I threw in some more code to skip blocks that have a "0" put in their spot (making an editor with it). What it does is takes me to the menu, I get to pick 0 players (I pick 0 until I finish it then I test the gameplay myself cause the computer can play faster then I can) and all it does is go to the blue sprite screen and uses a TON (not joking) of speed from my computer, where it should have played in about 5 secs or less I was waiting for 3 mins and still nothing. Here is the code...there is media required so if you need to download that it is attached.
Source:
flush video memory
Gosub MainMenu
Rem Main Program Loop
Game_Start:
Do
Gosub HUD
Gosub Player1_Move
Gosub Ball_Move
Sync
Loop
Rem ***** All Procedures Here *****
HUD:
Rem Code For HUD Here
text$="Lifes:"+str$(Lifes)
create bitmap 9008,screen width(),screen height()
text 0,0,text$
get image 9008,0,0,text width(text$),text height(text$),1
delete bitmap 9008
sprite 9008,0,0,9008
text$="Score:"+str$(Score#)
create bitmap 9009,screen width(),screen height()
text 0,0,text$
get image 9009,0,0,text width(text$),text height(text$),1
delete bitmap 9009
sprite 9009,213,0,9009
text$="Level:"+str$(Level)
create bitmap 9010,screen width(),screen height()
text 0,0,text$
get image 9010,0,0,text width(text$),text height(text$),1
delete bitmap 9010
sprite 9010,426,0,9010
Return
Player1_Move:
Rem Code For Updating Player 1 Paddle Position Here
If Option_Selected = 1
if rightkey()>0
rotate sprite 1,90
move sprite 1,PaddleSpeedX#
rotate sprite 1,360
endif
if leftkey()>0
rotate sprite 1,90
move sprite 1,-PaddleSpeedX#
rotate sprite 1,360
endif
else
Sprite 1,BallDirX#-33,459,1
endif
Return
Ball_Move:
Rem Code For Updating Ball Position Here
Sprite 2,BallDirX#,BallDirY#,2
If sprite collision(1,2)>0
BallSpeedY# = 0 - BallSpeedY#
endif
If sprite collision(1,4)>0
rotate sprite 1,90
Move Sprite 1,2
rotate sprite 1,360
endif
If sprite collision(1,5)>0
rotate sprite 1,90
Move Sprite 1,-2
rotate sprite 1,360
endif
If sprite collision(2,4)>0
BallSpeedX# = 0 - BallSpeedX#
endif
If sprite collision(2,5)>0
BallSpeedX# = 0 - BallSpeedX#
endif
If sprite collision(2,6)>0
BallSpeedY# = 0 - BallSpeedY#
Sprite 2,BallDirX#,BallDirY#,2
endif
If sprite collision(2,7)>0
BallSpeedY# = 0 - BallSpeedY#
Sprite 2,BallDirX#,BallDirY#,2
endif
If sprite collision(2,6)>0
Move Sprite 2,-2
endif
If sprite collision(2,7)>0
Gosub Lose_Life
endif
Sprite_X1 = BallDirX# / 64
Sprite_X2# = BallDirX# / 64.0
For a = 8 to TotalBricks
if sprite collision(2,a)>0
If Sprite_X1 = Sprite_X2#
BallSpeedX# = 0 - BallSpeedX#
else
BallSpeedY# = 0 - BallSpeedY#
endif
Sprite a,650,650,a
inc Score#,1
endif
next a
Inc BallDirX#,BallSpeedX#
Inc BallDirY#,BallSpeedY#
If Score / 169 = Score# / 169.0
If Score =>0 or Score# =>0
Gosub Game_Start
else
Gosub Level_Load
endif
endif
Return
MainMenu:
Do
Rem Code For Displaying Menu Here
cls
Print "Welcome to the Brick Breaker remake, made by Destrugter."
Print "The original place this game was downloaded from, was "
Print
Print "[0]0 Players"
Print "[1]1 Player"
Print "[2]Credits"
Print "[3]Level Editor"
Print "[4]Exit"
Print
Input "Please select your option.>",OptionSelected$
If OptionSelected$ = "0"
Gosub Setup_Game
endif
If OptionSelected$ = "1"
Gosub Setup_Game
endif
If OptionSelected$ = "2"
Gosub Credits
endif
If OptionSelected$ = "3"
Gosub Level_Editor
endif
If OptionSelected$ = "4"
End
endif
Loop
Return
Setup_Game:
Rem Code For Initialising Program Variables Here
Create animated sprite 1,"Media/Paddle.jpg",1,1,1
Create animated sprite 2,"Media/Ball.jpg",1,1,2
Create animated sprite 3,"Media/Brick.jpg",1,1,3
Create animated sprite 4,"Media/Vertical_Border.jpg",1,1,4
Create animated sprite 5,"Media/Vertical_Border.jpg",1,1,5
Create animated sprite 6,"Media/Horizontal_Border.jpg",1,1,6
Create animated sprite 7,"Media/Horizontal_Border.jpg",1,1,7
For x = 8 to 177
clone sprite 3,x
R = rnd(255)
G = rnd(255)
B = rnd(255)
If R = 0
repeat
R = rnd(255)
until R > 0
endif
If G = 0
repeat
G = rnd(255)
until G > 0
endif
If B = 0
repeat
B = rnd(255)
until B > 0
endif
set sprite diffuse x,R,G,B
next x
Sprite 1,288,459,1
Sprite 2,320,447,2
Sprite 4,-1,0,4
Sprite 5,640,0,5
Sprite 6,0,-1,6
Sprite 7,0,480,7
color backdrop RGB(0,0,0)
Gosub Game_Variables
Return
Credits:
cls
Print "This remake of the game ""Pong"" was made by Destrugter."
Print "The original version of ""Pong"" is copyrighted and respectfully belongs to"
Print "Ralph Baer."
Print
Print "[1]Back to the Main Menu"
Print "[2]Exit"
Print
Input "Please select your option.>",Option_2_Selected$
If Option_2_Selected$ = "1"
Gosub MainMenu
endif
If Option_2_Selected$ = "2"
end
endif
Game_Variables:
Dim Blocks$(169)
BallDirX# = 320
BallDirY# = 447
BallSpeedX# = 2
BallSpeedY# = 2
PaddleSpeedX# = 2
Lifes = 3
Score = Score#
Score# = 0
Level$ = str$(Level)
Level = val(Level$)
Option_Selected = Val(OptionSelected$)
TotalBricks = TotalBricks#
TotalBricks# = 177.0
Gosub Level_Load
Gosub Game_Start
return
Lose_Life:
Dec Lifes,1
Sprite 2,320,447,2
return
Level_Load:
Inc Level,1
File_Name$="Levels/"+Level$
if file exist(File_Name$)
open to read 1,File_Name$
for x=1 to 169
read string 1,Blocks$(x)
next x
close file 1
endif
Gosub Place_Bricks
return
Place_Bricks:
xpos = 0
ypos = 16
for a=8 to TotalBricks
For x=1 to 169
If Blocks$(x)="0"
inc xpos,64
dec TotalBricks,1
else
Sprite a,xpos,ypos,a
inc xpos,64
If xpos = 640
dec xpos,640
inc ypos,16
endif
endif
next x
next a
return
Level_Editor:
cls
Print "Welcome to the Breakout Level Editor."
Print "This level editor takes your level that you created, and puts it at the end of"
Print "the list of levels that it has the player complete."
Print "This means that you have to play through all of the levels to get to yours."
Print "If you have the latest version, it may have developed a level skip ability."
wait key
return
Attached source and media if you need it to help me.
EDIT:Forgot to attach media...see what I mean?
do you love video games a lot ¿¿¿ then comeon down too game zone252 @ http://www.freewebs.com/gamezone252/