Pacman Kata - Progressive F# Tutorials NYC 2013

17
PACMAN KATA Progressive F# Tutorials NYC 2013 Brandewinder & Trelford

Transcript of Pacman Kata - Progressive F# Tutorials NYC 2013

Page 1: Pacman Kata - Progressive F# Tutorials NYC 2013

PACMAN KATAProgressive F# Tutorials NYC 2013Brandewinder & Trelford

Page 2: Pacman Kata - Progressive F# Tutorials NYC 2013

PACMAN KATA

Pacman finds himself in a grid filled with monsters.

Will he be able to eat all the dots on the board before the monsters eat him?

• pacman is on a grid filled with dots

• pacman has a direction

• pacman moves on each tick

• user can rotate pacman

• pacman eats dots

Page 3: Pacman Kata - Progressive F# Tutorials NYC 2013

SESSION OVERVIEW

• Test Driven Pacman• Wrapping/Scoring

• Cross Platform• .Net/Mono/JS

• Game development 101• Input/AI/Rendering

• Tasks• Pacman has a direcation

• Ghosts navigate maze

Page 4: Pacman Kata - Progressive F# Tutorials NYC 2013

TEST DRIVEN PACMANProgressive F# Tutorials NYC 2013Brandewinder & Trelford

Page 5: Pacman Kata - Progressive F# Tutorials NYC 2013

PACMAN WRAPS AROUND

open NUnit.Framework

[<Test>]

let ``pacman should wrap from right to left`` () =

// ...

[<Test>]

let ``pacman should wrap from left to right`` () =

// ...

Page 6: Pacman Kata - Progressive F# Tutorials NYC 2013

PACMAN EATS STUFF

Scenario: Pacman eats dots

When pacman eats a pac-dot

Then he scores 10

Scenario: Pacman eats power pellets

When pacman eats a power pellet

Then he scores 50

Scenario Outline: Pacman eats ghosts

Given the ghosts are vulnerable

When pacman eats <ghost> in succession

Then he scores <points>

Examples:

| ghost | points |

| 1 | 200 |

| 2 | 400 |

| 3 | 800 |

| 4 | 1600 |

Page 7: Pacman Kata - Progressive F# Tutorials NYC 2013

CROSS PLATFORM F#Progressive F# Tutorials NYC 2013Brandewinder & Trelford

Page 8: Pacman Kata - Progressive F# Tutorials NYC 2013

CROSS PLATFORM F#

.Net•Windows•Windows Store•Windows Phone

Mono•Mac•Linux•iOS•Android•Ouya•Playstation Vita

JS•Chrome/IE•iOS•Android•Blackberry•Windows Phone•Windows Store

Page 9: Pacman Kata - Progressive F# Tutorials NYC 2013

APPS

Path to Go | XBLA Pissed off Owls| iOS Pool | WebGL

Page 10: Pacman Kata - Progressive F# Tutorials NYC 2013

FRAMEWORKS FOR GAMES

•.Net•WPF/Silverlight/WinRTXAML

•.Net/Mono•XNA/MonoGameXNA

•F# to JS Compilation•WebSharper/FunScript

HTML5

Page 11: Pacman Kata - Progressive F# Tutorials NYC 2013

GAME PROGRAMMING 101

Progressive F# Tutorials NYC 2013Brandewinder & Trelford

Page 12: Pacman Kata - Progressive F# Tutorials NYC 2013

GAME LOOP

User Input

Logic

Collision Detectio

n

Score

Render

Page 13: Pacman Kata - Progressive F# Tutorials NYC 2013

GAME TASKSProgressive F# Tutorials NYC 2013Brandewinder & Trelford

Page 14: Pacman Kata - Progressive F# Tutorials NYC 2013

TOO MUCH INPUT

Event

Sample

Page 15: Pacman Kata - Progressive F# Tutorials NYC 2013

EVERY WHICH WAY

forward turn

forward

Page 16: Pacman Kata - Progressive F# Tutorials NYC 2013

WHATEVER NEXTProgressive F# Tutorials NYC 2013Brandewinder & Trelford

Page 17: Pacman Kata - Progressive F# Tutorials NYC 2013

MAKE GAMES

Steps:

1. Enter game jams or join 1 game a month

2. Publish your indie game

3. Make $$$

4. Go to 1