|
| 1 | +# [fit] IHF: Code |
| 2 | +## [fit] Python — Making Games |
| 3 | +### Live at 2pm |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +# Send Code to |
| 8 | + |
| 9 | + |
| 10 | +--- |
| 11 | + |
| 12 | +# Questionnaire |
| 13 | + |
| 14 | +--- |
| 15 | + |
| 16 | +# Make a Game |
| 17 | + |
| 18 | +--- |
| 19 | + |
| 20 | +# Make a Game |
| 21 | +- Beetle |
| 22 | +- Rock, Paper, Scissors |
| 23 | +- Number guessing game |
| 24 | + |
| 25 | +--- |
| 26 | + |
| 27 | +# How games work |
| 28 | +- Number of players |
| 29 | +- Keep doing the same thing over and over until somebody wins |
| 30 | + |
| 31 | +```python |
| 32 | +def is_there_a_winner(): |
| 33 | + # Work out if a player meets the rules to win or not |
| 34 | + pass |
| 35 | + |
| 36 | +while not is_there_a_winner(): |
| 37 | + # Play the game here |
| 38 | +``` |
| 39 | + |
| 40 | +--- |
| 41 | + |
| 42 | +# Game Ideas |
| 43 | +- Snakes and ladders |
| 44 | +- Ludo |
| 45 | +- Deal or No Deal |
| 46 | +- Who wants to be a millionaire |
| 47 | +- Top Trumps |
| 48 | + |
| 49 | +--- |
| 50 | + |
| 51 | +# Snakes and ladders |
| 52 | +- Board from 1 to 100 |
| 53 | +- Mulitple players |
| 54 | +- If you land on different squares you move to other locations |
| 55 | +- Winner if the first to get to position 100 |
| 56 | +- Think about how you could display a board |
| 57 | + |
| 58 | +--- |
| 59 | + |
| 60 | +# Snakes and ladders |
| 61 | + |
| 62 | +```python |
| 63 | +100 99 98 97 96 95 94 93 92 91 |
| 64 | +... |
| 65 | +... |
| 66 | +... |
| 67 | +21 22 23 24 25 26 27 28 29 30 |
| 68 | +20 19 18 17 16 15 14 13 12 11 |
| 69 | +1 2 3 4 5 6 7 8 9 10 |
| 70 | +``` |
| 71 | + |
| 72 | +--- |
| 73 | + |
| 74 | +# Snakes and ladders - Extras |
| 75 | + |
| 76 | +- Randomly change the snakes and ladders |
| 77 | +- Have ladders break after one player uses them |
| 78 | + |
| 79 | +--- |
| 80 | + |
| 81 | +# Ludo |
| 82 | +- 4 pieces to move around a board |
| 83 | +- Think of the board as a straight line |
| 84 | +- Each players home base starts at a different place on the line (1, 10, 20, 30) |
| 85 | + |
| 86 | +--- |
| 87 | + |
| 88 | +# Ludo |
| 89 | + |
| 90 | + |
| 91 | +--- |
| 92 | + |
| 93 | +# Ludo |
| 94 | +```python |
| 95 | +1 2 3 4 5 6 7 8 9 10 |
| 96 | +39 11 |
| 97 | +38 12 |
| 98 | +37 R |
| 99 | +B 14 |
| 100 | +35 15 |
| 101 | +34 16 |
| 102 | +33 17 |
| 103 | +32 18 |
| 104 | +31 19 |
| 105 | +30 29 28 27 26 25 24 23 22 21 20 |
| 106 | +``` |
| 107 | + |
| 108 | +--- |
| 109 | + |
| 110 | +# Ludo - Extras |
| 111 | +- Knock people off the grid if you land on them |
| 112 | +- Need to roll a 6 to start a piece |
| 113 | +- Roll again if you get a 6 |
| 114 | +- Roll an exact number to get home |
| 115 | +- 3 6's in a row and your piece returns home |
| 116 | + |
| 117 | +--- |
| 118 | + |
| 119 | +# Deal or No Deal |
| 120 | +- Set of boxes with values in (1p to £250,000) |
| 121 | +- Player takes one box |
| 122 | +- Player picks other boxes to reveal whats inside them |
| 123 | +- Player ends up with their own box and one other box - they can then either keep their box or swap |
| 124 | +- Player wins the value in their box |
| 125 | + |
| 126 | +--- |
| 127 | + |
| 128 | +# Deal or No Deal |
| 129 | +- Randomly assign the prize amounts to boxes (shuffle the list) |
| 130 | +- Keep having the user pick a box to open until only 1 other box remains |
| 131 | + |
| 132 | +--- |
| 133 | + |
| 134 | +# Deal or No Deal - Extras |
| 135 | +- Replicate the banker to try and buy the box from the user |
| 136 | + |
| 137 | +--- |
| 138 | + |
| 139 | +# Who wants to be a millionaire |
| 140 | +- 15 questions |
| 141 | +- Each question has 4 possible answers |
| 142 | +- User has a set of life lines to help them (50/50, ask the audience, phone a friend) |
| 143 | + |
| 144 | +--- |
| 145 | + |
| 146 | +# Who wants to be a millionaire - Extras |
| 147 | +- How could you make an algorith for ask the audience or phone a friend? |
| 148 | + |
| 149 | +--- |
| 150 | + |
| 151 | +# Top Trumps |
| 152 | +- Set of cards that have a known set of attributes (strength, speed, power, magic, etc) |
| 153 | +- Divide the set between the number of players |
| 154 | +- Lead player picks an attribute from their top card and compares against all other users top card |
| 155 | +- Winner takes all the cards and they go to the bottom of their pack |
| 156 | +- Ultimate winner is the player who has all the cards |
| 157 | + |
| 158 | +--- |
| 159 | + |
| 160 | +# Top Trumps |
| 161 | +- Remember to shuffle the deck |
| 162 | +- Make a deck of cards (list of dictionaries) |
| 163 | +- Divide that list between multiple players |
| 164 | +- Top card is index 0 |
| 165 | + |
| 166 | +--- |
| 167 | + |
| 168 | +# Top Trumps - Extras |
| 169 | +- Keep a count of the winning cards to show the best card at the end |
| 170 | +- If cards draw, put them all into a temporary pile and the next winning hand gets them all |
| 171 | + |
| 172 | +--- |
| 173 | + |
| 174 | +# Extra Ideas |
| 175 | +- Monopoly |
| 176 | +- Battleships |
| 177 | +- Cluedo |
| 178 | +- Guess Who |
| 179 | +- Chess |
| 180 | +- Checkers |
| 181 | + |
| 182 | +--- |
| 183 | + |
| 184 | +# Send Code to |
| 185 | + |
| 186 | + |
| 187 | +--- |
| 188 | + |
| 189 | +### Questions? |
| 190 | +### go to sli.do #ihfcode |
| 191 | + |
| 192 | +--- |
| 193 | + |
| 194 | +# [fit] Next Session |
| 195 | +### Tuesday 23rd June 2pm |
| 196 | +### Making Games Continued |
0 commit comments