initial commit
This commit is contained in:
47
resources/public/js/cljs-runtime/frontend.il.app.js
Normal file
47
resources/public/js/cljs-runtime/frontend.il.app.js
Normal file
@@ -0,0 +1,47 @@
|
||||
goog.provide('frontend.il.app');
|
||||
var module$node_modules$pixi_DOT_js$lib$index=shadow.js.require("module$node_modules$pixi_DOT_js$lib$index", {});
|
||||
frontend.il.app.websocket = (function (){var G__21556 = (new WebSocket(["ws://",cljs.core.str.cljs$core$IFn$_invoke$arity$1(location.host),"/ws"].join('')));
|
||||
G__21556.addEventListener("open",(function (){
|
||||
return cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["Websocket opened."], 0));
|
||||
}));
|
||||
|
||||
G__21556.addEventListener("message",(function (p1__21555_SHARP_){
|
||||
return cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["Received message:",p1__21555_SHARP_.data], 0));
|
||||
}));
|
||||
|
||||
G__21556.addEventListener("close",(function (){
|
||||
return cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2(["Websocket closed."], 0));
|
||||
}));
|
||||
|
||||
return G__21556;
|
||||
})();
|
||||
frontend.il.app.ticker = (function frontend$il$app$ticker(game,ticker_object){
|
||||
var bunny = (game.cljs$core$IFn$_invoke$arity$1 ? game.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"bunny","bunny",1935768060)) : game.call(null,new cljs.core.Keyword(null,"bunny","bunny",1935768060)));
|
||||
return (bunny.rotation = (bunny.rotation + 0.01));
|
||||
});
|
||||
frontend.il.app.init = (function frontend$il$app$init(){
|
||||
var app = (new module$node_modules$pixi_DOT_js$lib$index.Application());
|
||||
var width = window.screen.width;
|
||||
var height = window.screen.height;
|
||||
return app.init(({"width": width, "height": height, "backgroundColor": (1087931)})).then((function (_){
|
||||
goog.dom.appendChild(goog.dom.getElement("app"),app.canvas);
|
||||
|
||||
var texture = module$node_modules$pixi_DOT_js$lib$index.Assets.load("https://www.sprite-ai.art/sprite-img/99fa1574-fc52-41a6-ab76-1bd75b5dc4b3/16x16-pixel-art-sprite-cookie-shaped-like-a-32x32-pixel-art-90b4.png");
|
||||
return texture.then((function (loaded_texture){
|
||||
var bunny = (new module$node_modules$pixi_DOT_js$lib$index.Sprite(loaded_texture));
|
||||
(bunny.anchor.x = 0.5);
|
||||
|
||||
(bunny.anchor.y = 0.5);
|
||||
|
||||
(bunny.x = (width / (2)));
|
||||
|
||||
(bunny.y = (height / (2)));
|
||||
|
||||
app.stage.addChild(bunny);
|
||||
|
||||
return app.ticker.add(cljs.core.partial.cljs$core$IFn$_invoke$arity$2(frontend.il.app.ticker,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"bunny","bunny",1935768060),bunny], null)));
|
||||
}));
|
||||
}));
|
||||
});
|
||||
|
||||
//# sourceMappingURL=frontend.il.app.js.map
|
||||
Reference in New Issue
Block a user