Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1664 | pj | 1 | RTOS PROJECT ILLA (GAME) |
2 | |||
3 | GROUP MEMBERS: BANTI MODI |
||
4 | RAJAT AHUJA |
||
5 | PRAKASH RAMACHANDRAN |
||
6 | |||
7 | |||
8 | |||
9 | Description of Game: |
||
10 | |||
11 | We had tried to make a game in which from has to jump on leaves flowing through the water, go to the lowest level and then come up. There is enemy of a from moving around on land. Enemy will try to kill the frog by touching it when frog is on the land. There is timer, after the expiration of timer the game will finish. |
||
12 | |||
13 | Details: |
||
14 | |||
15 | Tasks used: |
||
16 | |||
17 | 1) Scorer Task: |
||
18 | This is a hard task which keeps track of Timer and score of the player. The time for the game is 50 sec. We initialize the counter to 100 and then each time we reduce the counter and when timer is zero we exit. Currently we user update rate of 500000 microsecond and WET as 5000000 microsecond.(According to shark manual the WET will be ignored) |
||
19 | |||
20 | 2) MovePlayerUp and MovePlayerDown Tasks: |
||
21 | These are the soft tasks Which are created at beginning but they are not activated. These tasks are activated when user presses up or down key. These tasks move change the Y co-ordinates of a player during each cycle and redraws player till the player reaches next leaf level. When Player reaches the next level this task is blocked using task_disable. For this tasks we have default period of 25000 microsecond, WCET 500 microsecond and MET 100. |
||
22 | |||
23 | |||
24 | 3) Enemy Task: |
||
25 | This is soft task which is created during initialization. It Moves Enemy by 10 pixels during each execution cycle and checks if enemy touches the player co ordinates if it touches then we exit. For this tasks we have default period of 50000 microsecond, WCET 500 microsecond and MET 100. |
||
26 | |||
27 | 4) Leaves Task: |
||
28 | These are soft tasks which are created during Initialization. Each task is responsible for moving a single leaf in water. It also check if player is on leaf if it is then it also changes the co ordinates of player and redraws it. |
||
29 | For this tasks we have default period of 50000 microsecond, WCET 5000 microsecond and MET 1000. |
||
30 | |||
31 | 5) Others: |
||
32 | Apart from this we handle left or right move of player in Keyboard event. This is System Task and by default its soft TASK. |
||
33 | |||
34 | Synchronization: |
||
35 | |||
36 | We use following mutexs for synchronization: |
||
37 | |||
38 | We use Mutexs when accessing the co ordinates of players, leaves and Graphics card. Various tasks use those mutexs. Some tasks need to access various mutexs at same time. So in order to avoid cyclic wait we made some rules as we assign levels to each mutex. and when acquiring any high level mutex we must first release the lower level mutexs first. And after acquiring higher mutex we can take lower mutexs again. |
||
39 | |||
40 | 1) grx_mutex: This mutex is used before doing any graphical output function. This mutex is highest level. Before taking this mutes we must release any leaves and player mutex if any. |
||
41 | |||
42 | 2) player_mutex: This mutex is used before accessing any player co ordinates. This is second level of mutex. Before Acquiring this mutex we must release any leaves mutex if acquired. |
||
43 | |||
44 | 3) Leaves_mutex: These mutexs are used before accessing any co ordinates of any leaf. This is lowest level of mutexs. |