So I spent the last month trying to work on my last project, Atomic Satellite from Venus, but I just can't get stuff to work, maybe I'm not understanding the way things should be programed, who knows.
Anyway, I kept asking my brother for help, but he told me, "Make pong, then I'll help"
So I am, lol. I started on a simple pong game, with some flashy stuff. Nothing much. It' started out alright, but I think i screwed up my trig, or maybe I'm just not implementing it correctly in code. Try it out, and you will see what I mean
heres code: (screenshot attached)
Remstart *****************
Blast Pong
By: Blastwave Man
******************* Remend
Rem Setup Stuff
Set Display Mode 800,600,16 : Set Window On
Set Window Title "Blast Pong V1.5"
Sync Rate 0 : Sync On : Sync Rate 30
Autocam Off : Backdrop on : Color Backdrop 0
Rem Setup variables
rem ball vairables
B_Angle# = 45
B_Speed# = 5
rem player variables
One_Life# = 3
Two_Life# = 3
P_Speed# = 4
One_Score# = 0
Two_Score# = 0
Rem Create Arena
Position Camera 0,600,0 : Point Camera 0,0,0
rem arena
make object box 1,800,10,10 : color object 1,RGB(25,200,25)
position object 1,0,2.5,295
make object box 2,800,10,10 : color object 2,RGB(25,200,25)
position object 2,0,2.5,-295
make object box 3,10,10,600 : color object 3,RGB(25,200,25)
position object 3,395,2.5,0
make object box 4,10,10,600 : color object 4,RGB(25,200,25)
position object 4,-395,2.5,0
rem detail
make object box 5,10,10,600 : color object 5,RGB(20,150,20)
position object 5,0,-5,0
Rem Create Pattles and Ball
rem player one pattle
make object box 6,15,15,80 : color object 6,RGB(25,200,50)
position object 6,-350,0,0
rem player two pattle
make object box 7,15,15,80 : color object 7,RGB(25,200,50)
position object 7,350,0,0
rem make ball
make object cube 8,15 : color object 8,RGB(25,200,50)
position object 8,0,0,0
rem create background effects models
rem layer 01
for i = 1 to 50
make object box i+100,rnd(25)+40,5,5
position object i+100,rnd(1000)-500,-50,rnd(800)-400
next i
rem variables
oner# = 0
onel=0
rem layer 02
for a = 1 to 50
make object box a+200,rnd(25)+40,5,5
position object a+200,rnd(1000)-500,-100,rnd(800)-400
next a
rem variables
twob# = 0
twol=0
rem tex variables
set text size 36
Rem Main Loop
Do
Rem Print score/life/power
rem score
ink RGB(255,255,255),0 : center text 400,10,STR$(One_Score#)+"/"+STR$(Two_Score#)
Rem Player control
rem player one move
if keystate(17)=1 then move object 6,P_Speed#
if keystate(31)=1 then move object 6,-P_Speed#
if object position z(6)>245 then position object 6,object position x(6),object position y(6),245
if object position z(6)<-245 then position object 6,object position x(6),object position y(6),-245
rem player two move
if keystate(24)=1 then move object 7,P_Speed#
if keystate(38)=1 then move object 7,-P_Speed#
if object position z(7)>245 then position object 7,object position x(7),object position y(7),245
if object position z(7)<-245 then position object 7,object position x(7),object position y(7),-245
rem ball movement
move object right 8,speedx#
move object 8,speedz#
rem outer ring hit
rem upper
if object position z(8)>270
B_Angle#=B_Angle#-90
endif
rem lower
if object position z(8)<-270
B_Angle#=B_Angle#-90
endif
rem pattle hits
rem player 1
if object position x(8)<-315
if object position x(8)>-330
if object position z(8)<object position z(6)+40
if object position z(8)>object position z(6)-40
B_Angle#=B_Angle#-90
B_Speed#=B_Speed#+0.5
endif
endif
endif
endif
rem player 2
if object position x(8)>315
if object position x(8)<330
if object position z(8)<object position z(7)+40
if object position z(8)>object position z(7)-40
B_Angle#=B_Angle#-90
B_Speed#=B_Speed#+0.2
endif
endif
endif
endif
rem hit player 1 side/score
if object position x(8)<-385
position object 8,0,0,0
B_Speed# = 5
B_Angle# = RND(360)
Two_Score#=Two_Score#+1
endif
rem hit player 2 side/score
if object position x(8)>385
position object 8,0,0,0
B_Speed# = 5
B_Angle# = RND(360)
One_Score#=One_Score#+1
endif
rem move ball
speedx# = B_Speed#*(cos(B_Angle#))
speedz# = B_Speed#*(sin(B_Angle#))
Rem Background effect
rem layer 01
rem move and color layer01 objects
for t = 1 to 50
move object left t+100,20
if object position x(t+100)<-500
move object right t+100,1000
position object t+100,object position x(t+100),-50,rnd(800)-400
endif
if onel=0
oner#=oner#+1
if oner#>249 then onel=1
endif
if onel=1
oner#=oner#-1
if oner#<1 then onel=0
endif
color object t+100,RGB(oner#,0,0)
next t
rem layer 02
rem move and color layer01 objects
for x = 1 to 50
move object right x+200,20
if object position x(x+200)>500
move object left x+200,1000
position object x+200,object position x(x+200),-100,rnd(800)-400
endif
if twol=0
twob#=twob#+1
if twob#>249 then twol=1
endif
if twol=1
twob#=twob#-1
if twob#<1 then twol=0
endif
color object x+200,RGB(0,0,twob#)
next x
sync
Loop
Blastwave Man
"I wish I was a wizard, becuase then I could wave my wand and perfect code would just appear."