@moderrkowo/jsgl
Version:
Client-side JavaScript library for creating web 2D games. Focusing at objective game.
37 lines (36 loc) • 1.48 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.SimpleSprite = void 0;
var Sprite_1 = require("./Sprite");
/**
* @group Game Objects
*/
var SimpleSprite = /** @class */ (function (_super) {
__extends(SimpleSprite, _super);
function SimpleSprite(imageResourceKey) {
var _this = _super.call(this) || this;
_this._imageResourceKey = imageResourceKey;
return _this;
}
SimpleSprite.prototype.Start = function (event) {
this.texture = event.game.GetImage(this._imageResourceKey);
event.game.Update();
};
return SimpleSprite;
}(Sprite_1.Sprite));
exports.SimpleSprite = SimpleSprite;