Commit | Line | Data |
b3ef54ec |
1 | <div class="pod"> |
2 | <!-- INDEX START --> |
3 | <h3 id="TOP">Index</h3> |
4 | |
5 | <ul><li><a href="#NAME">NAME</a> |
6 | <ul><li><a href="#The_Overall_view">The Overall view</a> |
7 | <ul><li><a href="#The_Game_Loop">The Game Loop</a></li> |
8 | <li><a href="#The_Game_Logic">The Game Logic</a> |
9 | </li> |
10 | </ul> |
11 | </li> |
12 | </ul> |
13 | </li> |
14 | </ul><hr /> |
15 | <!-- INDEX END --> |
16 | |
17 | <h1 id="NAME">NAME</h1><p><a href="#TOP" class="toplink">Top</a></p> |
18 | <div id="NAME_CONTENT"> |
19 | <p>Let's Make Tetris</p> |
20 | |
21 | </div> |
22 | <h2 id="The_Overall_view">The Overall view</h2> |
23 | <div id="The_Overall_view_CONTENT"> |
24 | <p>All games are a while loop. So we will have something like this.</p> |
25 | |
26 | </div> |
27 | <h3 id="The_Game_Loop">The Game Loop</h3> |
28 | <div id="The_Game_Loop_CONTENT"> |
29 | <pre> package Tetris; |
30 | |
31 | sub run_game_fun_times |
32 | { |
33 | while(1) |
34 | { |
35 | #game logic here |
36 | } |
37 | } |
38 | |
39 | </pre> |
40 | <p>You need more code you say? Ok well, a game does two things more. </p> |
41 | |
42 | </div> |
43 | <h3 id="The_Game_Logic">The Game Logic</h3> |
44 | <div id="The_Game_Logic_CONTENT"> |
45 | <dl> |
46 | <dt>Input Events</dt> |
47 | <dd> |
48 | <p>A game essentially move objects (boxes, monsters so on) in time.</p> |
49 | <p> |
50 | <dl> |
51 | <dt>Time</dt> |
52 | <dd> |
53 | <p>In SDL time is measured in ticks.</p> |
54 | </dd> |
55 | <dt>User Input</dt> |
56 | </dl> |
57 | </p> |
58 | </dd> |
59 | <dt>Draw Everything</dt> |
60 | </dl> |
61 | <p>--Kartik |
62 | </p> |
63 | |
64 | </div> |
65 | </div> |