News:

PlayBASIC2DLL V0.99 Revision I Commercial Edition released! - Convert PlayBASIC programs to super fast Machine Code. 

Main Menu

Mouse Buster

Started by kevin, June 23, 2005, 10:00:41 PM

Previous topic - Next topic

kevin


PlayBASIC Code: [Select]
;===========================
; Program startup
; =============================


Setfps 100

Constant MaxSeconds=10

do
Show_INtro(MaxSeconds)
Play_Game(MaxSeconds)
loop




; =============================
; Display Intro
; =============================

Function Show_INtro(Seconds)
cx=getscreenwidth()/2
yh=20
t=timer()+2000
repeat
Cls 0
y=100
ink rgb(255,255,155)
centertext cx,y," Welcome to Mouse Buster":y=y+yh
ink rgb(255,255,255)
centertext cx,y," The Aim of this game is see how many times you can click ":y=y+yh
centertext cx,y," the left mouse button in "+str$(Seconds)+" seconds":y=y+yh
y=y+yh
ink rgb(155,255,255)
centertext cx,y, "Press Left Mouse to Start"
sync
until timer()>t and mousebutton()=1

EndFunction



; =============================
; PLay Game
; =============================

Function Play_Game(Seconds)
cx=getscreenwidth()/2
yh=20

repeat
Cls 0
inc frames

y=50
centertext cx,y,"--->>> Mouse Busting In Progress <<----": y=y+yh

centertext cx,y," Seconds Left:"+digits$(seconds,2): y=y+yh
y=y+yh

Clicks=0
EndTime=Timer()+1000

repeat
if mousebutton()=1 and mouseclick=0
mouseclick=1
inc CLicks
else
if mousebutton()=0
mouseclick=0
endif
endif
until Timer()=>EndTime

if Clicks>MAxClicks then MaxClicks=Clicks
TotalClicks#=TotalClicks#+Clicks

text cx-100,y," Clicks This Second:" +str$(clicks)
y=y+yh
text cx-100,y," Max Clicks Per Second:" +str$(maxclicks)
y=y+yh
text cx-100,y," Average Clicks Per Second:" +str$(TotalClicks#/frames)
Sync
dec seconds
until seconds<1


y=y+(yh*2)
ink rgb(255,0,0)
centertext cx,y," ------>> Game Over <<--------"
y=y+yh
centertext cx,y, "Total Clicks:"+Str$(TotalClicks#)
y=y+yh
centertext cx,y, "Your Ranking :"+GetRank(TotalCLicks#)
ink rgb(0,0,255)
y=y+yh
centertext cx,y,"<>> Press Mouse <>>"
sync

; Wait until a few seconds and passed then allow the mouse click to
; exit
resultstimer=timer()+4000
Repeat
until timer()=>resultstimer and MouseButton()=1


EndFunction


; ===============================================
; Get PLayers Rank Message
; ===============================================

Function GetRank(TotalClicks)
if TotalCLicks<2 then Rank$="Grand mother!"
if TotalCLicks=>2 then Rank$="is this thing on ?"
if TotalCLicks=>10 then Rank$="Yawn"
if TotalCLicks=>20 then Rank$="I can dribble faster than that"
if TotalCLicks=>30 then Rank$="Getting better"
if TotalCLicks=>40 then Rank$="Almost average"
if TotalCLicks=>50 then Rank$="Average clicker"
if TotalCLicks=>60 then Rank$="Better than average clicker"
if TotalCLicks=>70 then Rank$="Very good"
if TotalCLicks=>80 then Rank$="Excellent"
if TotalCLicks=>90 then Rank$="Click Master"
if TotalCLicks=>100 then Rank$="The ultimate Click Master"

EndFunction rank$







tomazmb

Hello,

My best score is 62, am I good or what ? :P

Have a nice day,

Tomaz
My computer specification:

AMD Athlon 64 2800+
MB ASUS K8V Socket 754 VIA K8T800
SB Audigy 2
3 GB RAM DDR 400 MHz PQI
AGP NVIDIA GeForce 7600GT 256 MB-Club 3D
Windows XP Pro SP2
DirectX 9.0c

new-be-new

Well, youre very good but I am the GOD OF MOUSE CLICKING!!

[attachmentid=273]

Im sorry if i missplaced attachment bcause first time im sending one!
NON BENE PRO TOTO LIBERTAS VENDITUR AURO!!!
Dubrovnik

mindsafe

#3
Well I've got 80, not to bad :-)