mirror of
https://github.com/openeggbert/mobile-eggbert-kni-web.git
synced 2025-03-25 15:47:51 +01:00
37 lines
771 B
C#
37 lines
771 B
C#
|
using System;
|
||
|
using Microsoft.JSInterop;
|
||
|
using Microsoft.Xna.Framework;
|
||
|
|
||
|
namespace WindowsPhoneSpeedyBlupi.Pages
|
||
|
{
|
||
|
public partial class Index
|
||
|
{
|
||
|
Game _game;
|
||
|
|
||
|
protected override void OnAfterRender(bool firstRender)
|
||
|
{
|
||
|
base.OnAfterRender(firstRender);
|
||
|
|
||
|
if (firstRender)
|
||
|
{
|
||
|
JsRuntime.InvokeAsync<object>("initRenderJS", DotNetObjectReference.Create(this));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
[JSInvokable]
|
||
|
public void TickDotNet()
|
||
|
{
|
||
|
// init game
|
||
|
if (_game == null)
|
||
|
{
|
||
|
_game = new WindowsPhoneSpeedyBlupiGame();
|
||
|
_game.Run();
|
||
|
}
|
||
|
|
||
|
// run gameloop
|
||
|
_game.Tick();
|
||
|
}
|
||
|
|
||
|
}
|
||
|
}
|