| Rev | Line | |
|---|
| [4080] | 1 | -- Get objects from orxonox |
|---|
| 2 | thisscript:addObject("GenericNPC", "Secondprisoner") |
|---|
| 3 | thisscript:addObject("FPSPlayer", "Player") |
|---|
| [3946] | 4 | |
|---|
| 5 | -- Initialises the random number generator |
|---|
| 6 | randinit = false |
|---|
| 7 | function randInit() |
|---|
| 8 | |
|---|
| 9 | if not randinit then |
|---|
| 10 | math.randomseed(os.clock()) |
|---|
| 11 | randinit = true |
|---|
| 12 | end |
|---|
| 13 | |
|---|
| 14 | end |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | function scream() |
|---|
| 18 | |
|---|
| 19 | end |
|---|
| 20 | |
|---|
| 21 | function tick(timestep) |
|---|
| 22 | |
|---|
| 23 | --io.write("Secondprisoner called \n") |
|---|
| 24 | randInit() |
|---|
| 25 | randNumber = 10 * math.random() |
|---|
| 26 | |
|---|
| 27 | if randNumber > 8 then |
|---|
| 28 | scream() |
|---|
| 29 | end |
|---|
| 30 | |
|---|
| 31 | return false |
|---|
| 32 | end |
|---|
Note: See
TracBrowser
for help on using the repository browser.