36. WebSharperって?
• 本家曰く “the world’s most versatile web and
mobile development framework for .NET”
• F# で書ける
37. WebSharperって?
• 本家曰く “the world’s most versatile web and
mobile development framework for .NET”
• F# で書ける
• JavaScript を書かずに JS の機能が使える
38. WebSharperって?
• 本家曰く “the world’s most versatile web and
mobile development framework for .NET”
• F# で書ける
• JavaScript を書かずに JS の機能が使える
• HTML5 などもいける
39. 例:よくあるゲームループ
Unity3D(C#) の例
public class Hoge : MonoBehaviour
{
void Update()
{
hoge();
}
}
67. 例:プレイヤー機の座標を送受信
F#側
[JavaScript]
let initSocket context =
let (|Text|Binary|) (data:obj) =
match data with
| :? string as text - Text text
| binary - Binary (AsArrayBuffer binary)
let socket = WebSocket(ws://localhost:19860/shooting)
socket.Onopen - (fun () -
PlayerShip.init | Json.Stringify | socket.Send
)
socket.Onmessage - (fun msg -
drawBackground context
match msg.Data with
| Text text -
text
| (Json.Parse AsInfo)
| draw context
| Binary _ - ()
)
socket