Created
January 17, 2017 01:48
-
-
Save paytonrules/c00a7fb6c813aefc29375c7ac050bdf8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let lookupImageKey = function | |
| EntityType.Laser _ -> Laser | |
| EntityType.Bullet _ -> Bullet | |
| _ -> LargeInvaderOpen | |
let lookupImage imageKey = Map.tryFind imageKey lookupTable | |
let positionImage image entity = | |
match entity with | |
| EntityType.Laser e -> {Image = image; | |
Position = {X = e.Entity.Position.X; | |
Y = e.Entity.Position.Y}} | |
| EntityType.Bullet e -> {Image = image; | |
Position = {X = e.Entity.Position.X; | |
Y = e.Entity.Position.Y}} | |
| _ -> {Image = image; Position = {X = 0.; Y = 0.}} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment