# Morning Stroll

## Development

Availability of LiveReload or similar utility for compiling CS to JS is assumed,
so the gruntfile doesn't provide such a build task.

## Notes

###Code not ported

(1c0ec7d):

- PlayState.as
  - 82
  - 86

###Code adapted

(1c0ec7d):

- PlayState.as
  - 90 to 98 combined, callbacks changed to signals
- Platform.as
  - `mapData` already exists

():

- Player.as
  - `currently` -> `state`
  - `controlled` -> IS_CONTROLLED, using `flags`
  - [`animDelegate` changed to use signals]
  - `updateFocus` -> NEEDS_CAMERA_FOCUS
  - default state `FALLING` -> `STILL`
  - `inMidAir` -> `isInMidAir`
  - `justFell` -> `isJustFallen`
  - `jumpTimer`, `cameraFocus`
  - added:
    - no parity: `facing`
  - events:
    - putting events in a collection and dynamically dispatching them
    - using lowest priority for animation delegation
    - making animation delegate an object
    - using partial application to send in target to handler

- Platform.as
  - no more `tileWidth`, `tileHeight` properties; as parameters

General:

- FlxObject -> GameObject
- FlxTimer -> setTimeout
  - `start` -> `timer = setTimeout`
  - `finished` -> `timer?`
  - `stop` -> `clearTimeout timer`
- no parity:
  - `FlxSprite::finished`
  - `FlxSprite::updateAnimation`
  - `FlxSprite::offset`
- `isTouching` -> `touching`
- `justTouched` -> `wasTouching`

## Todos

- Fully port existing code.
- Add and integrate UnderscoreJS.
- Refactor on Phaser:
  - Use signals to replace delegation.
  - Make camera speed be from a real tween.

## Legend

- Prefixes:
  - `p` - previous.
  - `o` - original.

# Morning Stroll

## Development

```bash
hlf-jquery> npm install

# to install
hlf-jquery> grunt install

# to read some docs
hlf-jquery> grunt docs

# to start developing
hlf-jquery> grunt
```

### Sample ST2 Project File

```json
{
  "folders":
  [
    {
      "path": "morning-stroll",
      "file_exclude_patterns":
      [
        "docs/*",
        "lib/*",
        "release/*"
      ],
      "folder_exclude_patterns":
      [
        ".grunt",
        "node_modules"
      ]
    }
  ]
}

```

## License

Copyright (c) 2012-2015 Yinglei Yang, Peng Wang

Clean up and update readme.
Clean up and update readme.