Search the Community
Showing results for tags 'visual studio 2013'.
-
I have installed VS 2013 and downloaded and unzipped phaser. I am currently trying to go throught the phaser typescript examples. how do i make VS 2013 point to the phaser directory so the examples can reference the phaser framework? hope this makes sense thanks in advance
- 13 replies
-
Hey Everyone, I created a Phaser starter project template for Visual Studio 2013 that uses JavaScript. You can view more here: https://github.com/funzeye/Phaser-Project-Template-Javascript https://visualstudiogallery.msdn.microsoft.com/e6eeccc4-3963-4e3d-8181-77d94ae67d9a TypeScript Version also Available: https://visualstudiogallery.msdn.microsoft.com/a4f5464e-897a-48c2-85e4-7ac2b1d92d0f
-
- Phaser
- visual studio
-
(and 4 more)
Tagged with:
-
Hi Everyone, I'm experimenting with phaser and js windows store apps. I created a very simple app, just moving some sprites on the screen. What troubles me is quite often when i run the app on local machine from visual studio it lags. The sprites gently jump rather than move smoothly. This happens randomly. One time everything works smooth, next time it lags again (without changing the code or starting any other applications or anything). I use game.debug.text to draw fps to the screen and every time the game laggs i have 67 or 65 or 63. When game runs smoothly fps is equals 60. The extra few fps that happen in corelation with the laggy behavior happen even if i use game.time.deltaCap = 1 / 60. Has anyone came accross something similar ? Any help appreciated . Thanks! Code: // For an introduction to the Blank template, see the following documentation: // http://go.microsoft.com/fwlink/?LinkID=392286 (function () { "use strict"; var app = WinJS.Application; var activation = Windows.ApplicationModel.Activation; // init for phaser; var game; var fishgroup; function preload() { //prealoaing assets game.load.image('xxx', 'images/test.png'); } function create() { game.time.advancedTiming = true; game.physics.startSystem(Phaser.Physics.ARCADE); fishgroup = game.add.group(); //game.stage.backgroundColor = '#ffffff'; game.time.advancedTiming = true; // game.time.deltaCap = 1 / 60; for (var i = 0; i < 5; i++) { var f = fishgroup.create(game.world.randomY, game.world.randomY, 'xxx'); game.physics.enable(f, Phaser.Physics.ARCADE); f.scale.setTo(2, 2); f.body.velocity.setTo(300, 0); } } function update() { for (var i = 0; i < fishgroup.length; i++) { var f = fishgroup.getAt(i); if (f.body.x > game.world.width) { f.reset(0 - f.body.width, f.body.y) //f.body.x = (0 - f.body.width); f.body.velocity.setTo(300, 0); } else if (f.body.x < 0 - f.body.width) { f.reset(game.world.width, f.body.y) // f.body.x = game.world.width; f.body.velocitysetTo(300, 0); } } } function render() { game.debug.text(game.time.fps + "---" + game.time.deltaCap + "---" + game.time.fpsMax, 100, 100); } app.onactivated = function (args) { if (args.detail.kind === activation.ActivationKind.launch) { if (args.detail.previousExecutionState !== activation.ApplicationExecutionState.terminated) { // TODO: This application has been newly launched. Initialize // your application here. game = new Phaser.Game(1600,900, Phaser.CANVAS, '',{ preload: preload, create: create, update: update, render: render}); } else { // TODO: This application has been reactivated from suspension. // Restore application state here. // load , unpause } args.setPromise(WinJS.UI.processAll()); } }; app.oncheckpoint = function (args) { // TODO: This application is about to be suspended. Save any state // that needs to persist across suspensions here. You might use the // WinJS.Application.sessionState object, which is automatically // saved and restored across suspension. If you need to complete an // asynchronous operation before your application is suspended, call // args.setPromise(). }; app.start(); })();
- 1 reply
-
- windows 8.1
- windows store app
-
(and 3 more)
Tagged with:
-
I'm using VS Express 2013 for the Web and following this tutorial: http://www.photonstorm.com/phaser/advanced-phaser-and-typescript-projects My code: Game.ts ///<reference path="phaser.d.ts"/>module Crazytopia { export class Game extends Phaser.Game { constructor() { super(1023, 630, Phaser.AUTO, 'content', null); this.state.add('Boot', Boot, false); this.state.add('Preloader', Preloader, false); this.state.add('Menu', Menu, false); this.state.add('Room_1', Room_1, false); this.state.start('Boot'); } }} Boot.ts module Crazytopia { export class Boot extends Phaser.State { preload() { this.load.image('preloadBar','img/loader.png'); } create() { this.input.maxPointers = 1; this.stage.disableVisibilityChange = true; if (this.game.device.desktop) { // If you have any desktop specific settings, they can go in here [b][color=#ff0000]this.stage.scale.pageAlignHorizontally = true;[/color][/b] } this.game.state.start('Preloader', true, false); } }} Menu.ts module Crazytopia { export class Menu extends Phaser.State { username: Phaser.Text; menuTitle: Phaser.Text; create() { //this.stage.setBackgroundColor(0x2d2d2d); this.menuTitle = this.add.text(this.world.centerX, this.world.centerY, 'Enter your name:', { font: "30px Arial", fill: "#ffffff", align: "center" }); this.menuTitle.anchor.setTo(0.5, 0.5); this.username = this.add.text(this.world.centerX, this.world.centerY + 70, '', { font: "30px Arial", fill: "#ffffff", align: "center" }); this.username.anchor.setTo(0.5, 0.5); this.input.keyboard.addCallbacks(this, this.keyboardHandler); if (this.input.keyboard.addKey(Phaser.Keyboard.P).justPressed()) { this.startGame; } } keyboardHandler( evt ) { // Skip it unless it's a-z. if (evt.which < "A".charCodeAt(0) || evt.which > "Z".charCodeAt(0)) { console.log("Not a letter: ", evt.which); return; } var letter = String.fromCharCode(evt.which); if (!evt.shiftKey) letter = letter.toLowerCase(); this.username.setText(this.username.text + letter); } startGame() { this.game.state.start('Room_1', true, false); } }} Note: there is also Preloader.ts, Room_1.ts and app.ts but I do not think they are relevant to the problem (please correct me if I'm wrong). The errors I get: Error 1 The property 'setTo' does not exist on value of type 'PIXI.Point' (Menu.ts ln 17)this.menuTitle.anchor.setTo(0.5, 0.5);Error 2 The property 'setTo' does not exist on value of type 'PIXI.Point' (Menu.ts ln 25)this.username.anchor.setTo(0.5, 0.5);Error 3 The property 'pageAlignHorizontally' does not exist on value of type 'PIXI.Point' (Boot.ts ln 14)this.stage.scale.pageAlignHorizontally = true;I'm new to Typescript and Phaser so I have no idea what I'm doing wrong. Thanks for reading!
- 3 replies
-
- visual studio 2013
- typescript
-
(and 1 more)
Tagged with: