File: examples.html

package info (click to toggle)
trackballs 1.1.4-4
  • links: PTS
  • area: main
  • in suites: lenny, squeeze
  • size: 15,660 kB
  • ctags: 2,223
  • sloc: cpp: 14,584; sh: 3,867; lisp: 3,670; makefile: 151; ansic: 23; sed: 16
file content (50 lines) | stat: -rw-r--r-- 1,411 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title> Trackballs - Examples </title>
<link title="Default style" rel="stylesheet" href="default.css" type="text/css">
</head>
<body>

<div class="toc">
<ol>
<li> <a href="index.html"> Players guide </a> </li>
<li> <a href="customizing.html"> Creating your own levels </a> </li>
<li> <a href="mapeditor.html"> Map editor </a> </li>
<li> <a href="scriptingLanguage.html"> Scripting Language </a> </li>
<li> <a href="api.html"> API Reference </a> </li>
<li> <a href="examples.html"> Examples </a> </li>
</ol>
</div>

<div class="pagebody">

<h1> Examples </h1>

This section should contain some intersting examples of how things can
be done with the scripting language.
<p/>
<b>TODO: </b> Add some (more) interesting example uses of the scripting language here.
<p/>

This shows how create a flag which gives time as a reward instead of
point when it is taken. In this case the player gets 10 bonus seconds
by taking the flag.
<div class="code"><pre>
(define my-flag (add-flag 100 100 0 1 0.1))
(time-on-death my-flag 10.0) 
</pre></div>

And as you can see this trick works for many different types of
animated objects like Mr Black's, Babies, Birds, Cactuses and even the
player object himself!
<div class="code"><pre>
(define my-flag (new-mr-black 100.5 100.5))
(time-on-death my-flag 10.0) 
</pre></div>



</div>
</body>
</html>