GAME: Bash

By QuickStep on Oct 27, 2004

Another text based game just like shiffre, only this time you will have to bash your space button. It also stores your highscore. Start by typing '/bash'. Enjoy!
(My personal highscore is 129)

;You have full right to take this code/reproduce it, and you do not need my permission for it

alias bash {
  var %w = @bash, %timeset = -

  if ($hget(bash) = $null) {
    hmake bash 10    
    if ($isfile(bash.dat)) hload bash bash.dat
  }
  hadd bash game_enabled 1
  hadd bash startcountdown 3

  if ($hget(bash,highscore) !isnum) hadd bash highscore 0
  elseif (($hget(bash,time) != $null) && ($hget(bash,time) isnum)) %timeset = $asctime($hget(bash,time), dddd dd $+ oo of mmmm yyyy $+ $chr(44) HH:nn:ss)

  window %w | clear %w
  echo %w Welcome to BASH!
  echo %w ----------------
  echo %w Your highscore: $hget(bash,highscore)
  echo %w Set on: %timeset
  echo %w ----------------
  bashstarttimer
}
alias -l bashstarttimer {
  if ($hget(bash,game_enabled) = 0) { .timerbashstarttimer off | return }
  if ($hget(bash,startcountdown) = 0) { .timerbashstarttimer off | startbash | return }
  var %w = @bash, %com = rline %w 6
  if (!$line(%w,6)) %com = echo %w
  %com The game will start in4 $hget(bash,startcountdown) seconds...
  hdec bash startcountdown
  .timerbashstarttimer 1 1 bashstarttimer
}
alias -l startbash {
  hadd bash bashes 0
  hadd bash bashtimer 150
  var %w = @bash | clear %w
  echo %w Press [SPACE]! bash! bash! BASH!
  echo %w --------------------------------
  echo %w Bashes: $hget(bash,bashes)
  echo %w Time: $hget(bash,bashtimer)
  hadd bash game_enabled 2
  bashtimer
}
alias -l bashtimer {
  if ($hget(bash,game_enabled) != 2) {
    .timerbashtimer off | return
  }
  if ($hget(bash,bashtimer) = 0) bashgameover
  rline @bash 4 Time: $hget(bash,bashtimer)
  hdec bash bashtimer
  .timerbashtimer -m 1 100 bashtimer
}
alias -l bashgameover {
  hadd bash game_enabled 0
  var %w = @bash | clear %w
  if ($hget(bash,bashes) > $hget(bash,highscore)) {
    hadd bash highscore $hget(bash,bashes)
    hadd bash time $ctime
    hsave -o bash bash.dat
    echo %w 3NEW HIGHSCORE! ( $+ $hget(bash,highscore) $+ )
  }
  else {
    echo %w 4You scored $hget(bash,bashes) $+ , not enough for a highscore...
  }
  hadd bash game_enabled 3
  echo %w -------------------
  echo %w [ENTER] = Try again
  halt
}
on *:KEYUP:@bash:32:{
  if ($hget(bash,game_enabled) != 2) return
  hinc bash bashes
  rline @bash 3 Bashes: $hget(bash,bashes)
}
on *:KEYDOWN:@bash:13:if ($hget(bash,game_enabled) = 3) bash
on *:CLOSE:@bash:hadd -m bash game_enabled 0

Comments

Sign in to comment.
bugmenot   -  Feb 21, 2007

haha WOW i just got a new high score after trying like for the past 2 days
GOOD GAME. love it!
3NEW HIGHSCORE! (190)

[ENTER] = Try again

 Respond  
Maiden69   -  Aug 07, 2005

nice game .. 123 ... but too bad i broke my keyoard damn u :P lol

 Respond  
[-Superboyz-]   -  Nov 06, 2004

hahahaha..... cool games ... :P i get 183 and cant get a 184 :(((((((

 Respond  
Pri'sBaby   -  Oct 28, 2004

171, wow! i only reached 140

 Respond  
xDaeMoN   -  Oct 28, 2004

This is quite entertaining. Good job! NEW HIGHSCORE! (171) =D

 Respond  
Pri'sBaby   -  Oct 28, 2004

ok my personal highest is now: NEW HIGHSCORE! (136)

 Respond  
Pri'sBaby   -  Oct 28, 2004

wow my dad got 132 o.o

 Respond  
Pri'sBaby   -  Oct 28, 2004

yo!, i love this game, you are one hel of a scripter! amazing job

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.