Laser Tag Scoring in Design Philosophy
|
|
This may not be where this should go but I would call it "Code Philosophy" So this is the closest thing to that...
I'm making a Laser Tag game and I'm not at home so I can't test this code. If any of you could tell me how "good" or "bad" this code is, it would be appreciated.
Sorting Players Based on Score:
proc/pickHighest(var/i) var/highest=0 var/mob/R for(;i<players.len;i++) if(players[i].score >= highest) highest=players[i].score R=players[i] return R
proc/sortPlayers() var/i=1 for(var/mob/M in players) scores[i]=pickHighest(i) i++
|
Calculating Score:
mob/proc/calAccuracy() if(src.client) return((Shots_Hit/Shots_Fired)*100) else return 0
mob/proc/calScore() if(src.client) var/temp_score= src.Shots_Hit * 3.5 return temp_score + (temp_score * (src.calAccuracy()/100)) else return 0
|
Thats what I've got for now, what do you guys/girls think?
Is it good?
Will it work?
Is it efficient?
-KirbyAllStar
|