Search the Community

Showing results for tags 'typescript'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Platform
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 244 results

  1. I've created a boilerplate for Phaser, you can grab it here: https://github.com/cloakedninjas/phaser-typescript-boilerplate It's very slim, it provides just the bare minimal components to get going quickly.
  2. Phaser Project Setup Using Typescript via Terminal and GruntJS I'm trying to start my first Phaser project ever but I want to do it with typescript since it's one of the main reasons why I'm doing this project to begin with in order to learn Typescript. I'm working of an old Mac Pro 3,1 running Snow Leopard and there is no way for me to upgrade, just in case that issue comes up. I'm also coding via terminal using GruntJS as my preprocessor, MAMP as my webserver and for everything else I use sublime. Anywho because I don't have VS and most tutorials regarding Typescript and Phaser use VS as the main IDE, I figured I may have lost a couple of steps along the way or something. All I know is that my Typescript is giving me errors no matter what I try. The precompiler which is grunt-ts seems to be working jst fine but right away I get an error in my code on line 1 column 1, so I'm guessing it's something I'm doing wrong codewise. here is my app.js: /// <reference path="../typescript/phaser.d.ts"/> class SimpleGame { constructor() { this.game = new Phaser.Game(800, 600, Phaser.AUTO, 'content', { preload: this.preload, create: this.create }); } game: Phaser.Game; preload() { this.game.load.image('logo', 'phaser2.png'); } create() { var logo = this.game.add.sprite(this.game.world.centerX, this.game.world.centerY, 'logo'); logo.anchor.setTo(0.5, 0.5); } } window.onload = () => { var game = new SimpleGame(); }; and Here is the error I get on grunt-ts while compiling to javascript: Running "ts:dev" (ts) task Compiling... ### Fast Compile >>ts/app.ts ### Fast Compile >>ts/phaser.d.ts Using tsc v1.6.2 /Users/ish/Games/Phaser_html5/demo_01/ts/phaser.d.ts(1,1): error TS6053: File '/Users/ish/Games/Phaser_html5/demo_01/ts/pixi.d.ts' not found. /Users/ish/Games/Phaser_html5/demo_01/ts/phaser.d.ts(2,1): error TS6053: File '/Users/ish/Games/Phaser_html5/demo_01/ts/p2.d.ts' not found. /Users/ish/Games/Phaser_html5/demo_01/ts/phaser.d.ts(7,15): error TS2300: Duplicate identifier 'Phaser'. /Users/ish/Games/Phaser_html5/demo_01/ts/phaser.d.ts(56,16): error TS2300: Duplicate identifier 'Phaser'. /Users/ish/Games/Phaser_html5/demo_01/typescript/phaser.d.ts(7,15): error TS2300: Duplicate identifier 'Phaser'. /Users/ish/Games/Phaser_html5/demo_01/typescript/phaser.d.ts(56,16): error TS2300: Duplicate identifier 'Phaser'. >> 6 non-emit-preventing type warnings >> Error: tsc return code: 2 Warning: Task "ts:dev" failed. Use --force to continue. Aborted due to warnings. Which, for me, begs the question: How do I reference all of the Phaser framework files when not using an IDE like VS? How would I manually incorporate the Phaser engine into my project and reference the files? Say if I download the Phaser framework manually via my browser. How would I setup those files in that folder on my project? I can't seem to find a direct reference or tutorial to that anywhere. The ones involving typescript use Visual Studio as the ide and the ones that do not use VS only use plain vanilla javascript code. I'm looking for tuts that use Typescript but not any particular ide preferably just terminal or command prompt. Any help appreciated. Thanks.
  3. Hi everyone. I'm playing around with TypeScript and Phaser for the first time. I started off with plain Javascript/Phaser in Sublime and got a little game going where I could move a sprite around the screen and click to shoot. It worked relatively easily which was nice. Then I decided to switch to TypeScript and Visual Studio because intellisense and the class/inheritance syntax looked like it would make things easier. I still have hope, but I've run into some problems. The first issue that came up was setting up WASD controls with AddKey. I tried to use the recommended var movementLeftKey: Phaser.Key = game.input.keyboard.addKey(Phaser.KeyCode.A);but I got the message: Property 'KeyCode' does not exist on 'typeof Phaser' I got around it by using var movementLeftKey: Phaser.Key = game.input.keyboard.addKey(Phaser.Keyboard.A)This made me think that I was using the wrong version of phaser files since 2.4.4 ought to allow KeyCode. Unless I'm doing something wrong(certainly possible), I believe I'm all up to date. I have p2.d.ts, phaser.d.ts, phaser.js, phaser.min.js, and pixi.comments.d.ts from https://github.com/photonstorm/phaser/tree/master/typescript all in my project as recommended in the typescript tutorial: http://phaser.io/tutorials/how-to-use-phaser-with-typescript I wanted to use phaser.comments.d.ts instead of phaser.d.ts, but it looks like it hasn't been updated - the version appears to be 2.4.3 rather than 2.4.4 Another issue is with detecting mouse clicks. Before typescript/visual studio, I used game.input.activePointer.leftButton.isDown to check if the player was clicking. Visual Studio won't even compile that because it says game.input.activePointer.leftButton is a boolean. All of the Phaser documentation says it's a DeviceButton, and I've even printed out the value with console.log and it says it's an [object Object], so definitely not a boolean. Any ideas why Visual Studio thinks otherwise? I am using the most recent version of typescript that came installed with Visual Studio 2015 Community. Here's my project on Github. I haven't ever used github before so if something appears messed up with how I uploaded it, that's why and please let me know. The code dealing with mouse and keyboard input is here. Thanks in advance for any advice.
  4. So I have 2 classes. A & B. When a specific event occurs in A, a method in B is called. I don't want to create objects in the classes. How else would you do it?
  5. Newbie programmer here using phaser for one of my uni assignments! I'm building a side-scrolling oldschool Adventure game. Question 1: What is the correct usage of input.poiterOver()? I have multiple sprites defined on a class Level1.ts basically the usage I'm after is you roll over a mouse on the sprite, it displays the sprite name and you roll-off and the name should disappear. It seems like you cannot do this with multiple sprites in the same context? It will work for ONE sprite (the last sprite called in update() but not any others. What gives? I've encapsulated the sprites as follows: -all sprites are created in create() statue = this.game.add.sprite(330, 162, "statue");statue.inputEnabled = true;innkeeper = this.game.add.sprite(1035, 228, "innkeeper");innkeeper.inputEnabled = true;-then their behavior sits in their own method: (its the same for all sprites) npcInkeeper() { //innkeeper. if (innkeeper.input.pointerOver()) { this.onOverNPC(innkeeper, "Innkeeper"); this.game.input.onDown.add(this.dialogInnkeeper, this.npcInkeeper, 1); } else if (!innkeeper.input.pointerOver()) { this.onOutNPC_name(); } switch (counter_innkeeper) { case 1: //blah blah blah more code and finally in the update() method they are called to update by name. So how do you get this to work for multiple sprites? Question 2: "this.game.input.onDown.add" Is this the best method for a one-off call from mouse? Why can it only be used once on one sprite before going inactive? Same code as above.. Essentially after you roll over a sprite to reveal its name I'm using input.onDown.add to call its dialog method to start once you click. It's important I use one-click here because my dialog system is very hacky (ie: it triggers a counter and then a switch/case displays dialog based on the counter timer) I'm sure there's a better way to do this but all of the mouse methods in phaser were driving me nuts (doensn't appear to be any "onclick" method) only methods that spam ondown calls. The problem? You can apparently only use "input.onDown.add" once. It works on one sprite and then appears to go inactive to being triggered again? I've tried to call removeAll and Dispose on it per the Docs, but to no avail. I've also tried giving it a context (refer to code above) (this.npcInkeeper) to each sprite and also tried giving it a execution priority number. So is there anyway to reset the method? I'm definitely open to suggestions to change stuff. As I've said there doesn't appear to be a way to use a traditional JS .onclick method in phaser if not accessing the DOM (I may just not know the correct way to do it though) if anyone knows how to use it in regards to a phaser.sprite I'm all ears.
  6. Hi ! I've started "normal" web developpement two months ago, and it was painful. I'm coming from C# developpemement and Javascript is chinese to me. So, I look to Typescript and Dart (and Coffescript, but I think it's worse). I want to use Pixi.js or EaselJs But as far as I can see, it's not so easy to import Javascript librairies in Dart. Is someone tried these language and can tell me how it worked ?
  7. Typescript says you the first call of constructor() should be super() so this isn't possible: constructor() { var devicePixelRatio = Math.min(Math.round(window.devicePixelRatio), 3) || 1; super({ renderer: Phaser.AUTO, width: window.innerWidth * devicePixelRatio, height: window.innerHeight * devicePixelRatio });}But then doing this gets the error: Cannot read property 'setGameSize' of null constructor(gameVars:any) { super({ renderer: Phaser.AUTO, parent: 'canvasContainer' }); var devicePixelRatio = Math.min(Math.round(window.devicePixelRatio), 3) || 1; this.scale.setGameSize(window.innerWidth * devicePixelRatio, window.innerHeight * devicePixelRatio);}When does the ScaleManager come into existence?
  8. Hey guys, I am trying to set the game world bounds everytime I am zooming in/out of a map however, when I apply a tween to the game world bounds, it is not working. Here is my code var t = this.game.add.tween(this.sprites.scale); function mouseWheel(event) { var tween = myGame.add.tween(myGame.world.bounds); if (event.wheelDelta > 0 && scale <= 1) { scale += 0.1; sprites.scale.setTo(scale, scale); myPlayer.body.setSize(50 * scale, 50 * scale, 20 * scale, 80 * scale); myHouse.body.setSize(150 * scale, 50 * scale, 20 * scale, 240 * scale); myCharacter.body.setSize(110 * scale, 20 * scale, 0, 120 * scale); myHydro.body.setSize(100 * scale, 100 * scale, 100 * scale, 100 * scale); tween.to({width:5263*scale,height:2636*scale},50); tween.start(); // myGame.world.setBounds(0, 0, 5263 * scale, 2636 * scale); } else if (event.wheelDelta < 0 && scale >= 0.5) { scale -= 0.1; } else { t.stop(); } sprites.scale.setTo(scale, scale); myPlayer.body.setSize(50 * scale, 50 * scale, 20 * scale, 80 * scale); myHouse.body.setSize(150 * scale, 50 * scale, 20 * scale, 240 * scale); myCharacter.body.setSize(110 * scale, 20 * scale, 0, 120 * scale); myHydro.body.setSize(100 * scale, 100 * scale, 100 * scale, 100 * scale); tween.to({width:5263*scale,height:(2636+getHeight())*scale},50); tween.start(); // myGame.world.setBounds(0, 0, 5263 * scale, (2636 + getHeight()) * scale); }The part that is not working is this var tween = myGame.add.tween(myGame.world.bounds);tween.to({width:5263*scale,height:(2636+getHeight())*scale},50);tween.start();The code basically scales down/up a group of sprites including the map whenever the wheel is up/down. That works perfectly! Why do you think the tween is not working on the game world bounds?
  9. Hi, I'm having trouble with TypeScript when trying to create a custom preloader function/graphic does anybody know a solution please? thanks j class Main { // onFileComplete can't find this function myLoadUpdate() { console.log("myLoadUpdate"); } preload () { this.game.load.image("star", "assets/star.png"); this.game.load.onFileComplete.add(this.myLoadUpdate, this); // => Uncaught Error: Phaser.Signal: listener is a required param of add() and should be a Function. }}
  10. I'm creating my first Phaser game as a chromecast receiver app, I'm having some trouble with my code. The code I have below works: class TNSeconds { game: Phaser.Game; constructor() { this.game = new Phaser.Game(window.innerWidth * window.devicePixelRatio -20, window.innerHeight * window.devicePixelRatio -20, Phaser.CANVAS, 'content', { preload: this.preload, create: this.create }); } preload() { this.game.load.image('BG', 'bg.png'); this.game.load.atlas("Atlas", "atlas.png", "atlas.json"); } create() { var background= this.game.add.sprite(this.game.world.centerX, this.game.world.centerY, 'BG'); logo.anchor.setTo(0.5, 0.5); this.game.add.sprite(320, 100, "Atlas", "dron1", this.game.world); } } window.onload = () => { var game = new TNSeconds(); }; However I'm following a tutorial and the example has the code laid out as so: class Game extends Phaser.Game { constructor() { // init game super(window.innerWidth * window.devicePixelRatio - 20, window.innerHeight * window.devicePixelRatio - 20, Phaser.CANVAS, 'content', State); } } class State extends Phaser.State { preload() { this.game.load.image('BG', 'bg.png'); this.game.load.atlas("Atlas", "atlas.png", "atlas.json"); } create() { this.add.image(0, 0, "BG"); this.add.sprite(320, 100, "Atlas", "dron1", this.world); } } window.onload = () => { var game = new Game(); }; The tutorials code seems cleaner and just for the sake of follwoing the tutorial I would like to implement my code similarly, the problem seems to be that the `State` class isn't initializing, could anybody shed some light on this for me. I'm aware the tutorial code is using `this.add.image` where I'm using `this.game.add.sprite` this is not an issue.
  11. I'm starting to re-work my game using TS and now using Visual Studio 2013. IIS works perfect for me to test and iterate my game rapidly but I need to test it on my device as well. When working with Phaser JS, I need only to set up gruntfile.js, launch grunt, edit a little something and it will work. Can anyone please tell me how to test my game on my device or if needed, set up custom web server in VS? Thanks!
  12. Hello guys, I read http://www.html5gamedevs.com/topic/6495-add-more-custom-properties-to-sprite/ already and understand that in javascript it's free to add any custom property into any object. but i just get started Phaser with TypeScript because of I have experience in strong-type language like C#. I use its type-strict and don't want to use "any" type in order to use intellisense, that make i cannot add custom property to sprite object. Could you mind to tell me how to solve this problem ?
  13. Hey everyone. I've been meaning to post here more often, and I finally found an excuse today. As we know, getting up and running with a simple web game development project can be very time consuming. So many frameworks to choose from, dependencies to manage, etc. Today I updated my typescript/pixi template which has been working out pretty well for me so far (Thinking of making a Phaser one soon). This got me thinking. What templates do you usually use for getting started with new projects ? What if you want to hammer out a quick prototype ? Do you start from scratch ? Copy stuff from old projects ? Just curious what most people's workflow is for this.
  14. Hi, just tried to read right mouse click with Phaser.Pointer.rightButton, but I found, that Typescript def says that this is boolean. It should be Phaser.DeviceButton. The same is for middleButton and leftButton. Phaser.DeviceButton is missing in phaser.d.ts completely. So, if you need to read specific mouse buttons, add this into phaser.d.ts (not sure if I put right type to "event"...?): class DeviceButton { constructor(parent: Phaser.Pointer | Phaser.SinglePad, buttonCode: number) parent: Phaser.Pointer | Phaser.SinglePad; game: Phaser.Game; event: any; isDown: boolean; isUp: boolean; timeDown: number; duration: number; timeUp: number; repeats: number; altKey: boolean; shiftKey: boolean; ctrlKey: boolean; value: number; buttonCode: number; onDown: Phaser.Signal; onUp: Phaser.Signal; onFloat: Phaser.Signal; start(event: any, value: number): void; stop(event: any, value: number): void; padFloat(value: number): void; justPressed(duration: number): boolean; justReleased(duration: number): boolean; reset(): void; destroy(): void; } Then change rightButton, leftButton and middleButton defs in Phaser.Pointer class from boolean to Phaser.DeviceButton: leftButton: Phaser.DeviceButton; // boolean; ... and everything works.
  15. I would like to add few fixes in phaser.d.ts file. Should I manually make exact changes in comments file? I assume that comments file generated by combining docs from source js files and phaser.d.ts itself. But I can't find any grunt task for this.
  16. Hello everyone, It's my first topic in that forum and I'm here today because I've an (logicial ?) issue with the physics librairy p2.js. I'll try to explain my problem in the simplest way possible. I'm working on a game based on my own framework coupled with p2.js. In that game, the physical world needs to be updated at a constant time. For now, I'm using a requestAnimationFrame to call the world.step function but that means if the player have a slower PC, the game will be slower and the opposite is also true. I've made an animation in Photoshop (not perfect but whatever) to show you what I exactly want: So, I've two objects that are supposed to move at the same speed. Let's assume that the red line is the timeline. With the first object, we see when we have a little freeze, he stop then continue with the same speed where he stopped. But when you look at the second one, after the freeze occurred the object goes to the correct position following the timeline. My question is, can we do that with p2.js ? Or it's not about p2.js and I'm missing something ? I did some tests based on the documentation with the others arguments for the function world.step() but doesn't seems to work at all. Hope you can help me with this problem and thanks for your answers ! Have a great day
  17. Hi, I've been using Phaser with Notepad++ until now but I decided to try Visual Studio with Typescript (everyone praised the IntelliSense, so I thought it would be good to test it myself). I'm a completely noob so maybe I screwed up in something pretty obvious, but the IntelliSense is not working. The strange thing is that it worked at first... but it doesn't work now. I tried with the references to the phaser files but the problem persists. Is there something I'm missing?
  18. I'm trying to extend the Phaser.Image class in Typescript so I can create some buttons for my UI, and remove some clutter from my main js file. IE: exitButton.anchor.setTo(0.5, 0.5);exitButton.inputEnabled = true;exitButton.visible = true;to var exitImage = new ButtonImage(this.game, (this.scale.width -this.yGridMargin), this.scale.height, 'buttonSheet', 5);When I run the game chrome and firefox return this.game is null or cannot read property cache of null. The console seems to be point to line 35779 in the phaser.js file. else if (typeof key === 'string' && !this.game.cache.checkImageKey(key))ButtonImage ///<reference path = "../tsDefinitions/phaser.d.ts" />module BasicGame{ export class ButtonImage extends Phaser.Image{ constructor(game: Phaser.Game, x:number, y:number, key:any, frame: number | string){ //constructor(x: number, y:number, key: any | 'string', frame: number | string){ super(this.game, x, y, key, frame); this.anchor.setTo(0.5, 0.5); this.inputEnabled = true; this.visible = true; //game.add.existing(this); } } }Any help is much appreciated. *edit for language context
  19. I want to organise my resources into subfolders. However, I am then unable to access them. I tried the conventional /FolderName/image.jpg syntax, and it doesn't work. Although this seems really simple, I couldn't find the solution on Google either.
  20. Hey there, I've done quite some research, but I'm not totally satisfied with what I found. Just to be sure here's my question: What is actually the most robust and elegant automated solution for deserializing JSON to TypeScript runtime class instances? Say I got this class: class Foo { name: string; GetName(): string { return this.name };}And say I got this JSON string for deserialization: {"name": "John Doe"}What's the best and most maintainable solution for getting an instance of a Foo class with the name set to "John Doe" and the method GetName() to work? I'm asking very specifically because I know it's easy to deserialize to a pure data-object. I'm wondering if it's possible to get a class instance with working methods, without having to do any manual parsing or any manual data copying. If a fully automated solution isn't possible, what's the next best solution? Thanks and cheers.
  21. Hi, I am using Phaser with TypeScript and encountered some strange behavior: If I create some shape objects and change the position of one of them, the new position is applied to it (relative to the initial position) and to all other objects as well. I want to change the position of only one object, not all. How can I achieve that? here is some code for testing: class Main { game: Phaser.Game; graphics: Phaser.Graphics; constructor() { this.game = new Phaser.Game(800, 600, Phaser.AUTO, 'content', { create: this.create }); } create() { this.graphics = this.game.add.graphics(0, 0); this.graphics.lineStyle(5, 0xffffff); var circle1 = this.graphics.drawCircle(0.5 * this.game.width, 0.5 * this.game.height, 400); var circle2 = this.graphics.drawCircle(0.5 * this.game.width, 0.5 * this.game.height, 200); // this line shifts both circles. But why? circle1.position.set(100, 100); } }window.onload = () =>{ var game = new Main();};PS: it seems like the radius parameter of the drawCircle() method expects the diameter instead of the radius...
  22. Hi, i'm using this file in my project : /*Copyright © 2013 Marian Euent Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS INTHE SOFTWARE.*//* @param {Object} object: Any object you want to tween. For example: PIXI.Sprite @param {String} property: the property which needs to be changed. Use "property.property.property..." if the property is little deeper. Pass "" to create a Wait-Tween @param {float} value: targetValue of tweening @param {int} frames: duration of the tween in frames. @param {boolean} autostart: starting when created? Set to false if you use it with ChainedTween use examples: new Tween(sprite, "position.x", 100, 60, true); new Tween(sprite.position, "x", 100, 60, true); */function Tween(object, property, value, frames, autostart) { this.object = object; var properties = property.split("."); this.property = properties[properties.length - 1]; for (var i = 0; i < properties.length - 1; i++) { this.object = this.object[properties]; } this.targetValue = value; this.startValue; this.active = autostart; this.currentFrame = 0; this.endFrame = frames; this.onComplete; this.onCompleteParams; this.easing = Tween.noEase; Tween.tweens.push(this);}Tween.noEase = function (t, b, c, d) { t /= d; return b + c * (t);};Tween.prototype.setOnComplete = function (callback, parameters) { this.onComplete = callback; this.onCompleteParams = parameters;};Tween.prototype.start = function () { this.active = true;};Tween.prototype.initIterations = function () { if (this.property != "") { this.startValue = this.object[this.property]; this.targetValue = this.targetValue - this.object[this.property]; }};Tween.prototype.update = function () { if (!this.active) { return false; } if (this.currentFrame == 0) { this.initIterations(); } this.currentFrame++; if (this.currentFrame <= this.endFrame) { if (this.property != "") { var oldValue = this.object[this.property]; var newValue = this.easing(this.currentFrame, this.startValue, this.targetValue, this.endFrame); this.object[this.property] = newValue; } return false; } else { this.active = false; if (this.onComplete != null) { this.onComplete(this.onCompleteParams); } return true; }};Tween.tweens = [];// Call this every Frame of your Game/Application to keep the tweens running.Tween.runTweens = function () { for (var i = 0; i < Tween.tweens.length; i++) { var tween = Tween.tweens; if (tween.update()) { var index = Tween.tweens.indexOf(tween); if (index != -1) { Tween.tweens.splice(index, 1); } i--; } }};// EASING// use example:// var tween = new Tween(sprite, "alpha", 0, 60, true);// tween.easing = Tween.outElastic;Tween.outElastic = function (t, b, c, d) { var ts = (t /= d) * t; var tc = ts * t; return b + c * (33 * tc * ts + -106 * ts * ts + 126 * tc + -67 * ts + 15 * t);};Tween.inElastic = function (t, b, c, d) { var ts = (t /= d) * t; var tc = ts * t; return b + c * (56 * tc * ts + -105 * ts * ts + 60 * tc + -10 * ts);};Tween.inOutQuintic = function (t, b, c, d) { var ts = (t /= d) * t; var tc = ts * t; return b + c * (6 * tc * ts + -15 * ts * ts + 10 * tc);};Tween.inQuintic = function (t, b, c, d) { var ts = (t /= d) * t; var tc = ts * t; return b + c * (tc * ts);};Tween.outQuintic = function (t, b, c, d) { var ts = (t /= d) * t; var tc = ts * t; return b + c * (tc * ts + -5 * ts * ts + 10 * tc + -10 * ts + 5 * t);};Tween.inCubic = function (t, b, c, d) { var tc = (t /= d) * t * t; return b + c * (tc);};Tween.inOutCubic = function (t, b, c, d) { var ts = (t /= d) * t; var tc = ts * t; return b + c * (-2 * tc + 3 * ts);};Tween.outCubic = function (t, b, c, d) { var ts = (t /= d) * t; var tc = ts * t; return b + c * (tc + -3 * ts + 3 * t);};// CHAINED TWEEN/* @param {Array} tweens: Array of Tweens. example: var tween1 = new Tween(sprite, "position.x", 100, 60, false); var tween2 = new Tween(sprite, "position.x", 0, 60, false); new ChainedTween([tween1, tween2]);*/function ChainedTween(tweens) { this.tweens = tweens; Tween.tweens.push(this);}ChainedTween.prototype.update = function () { if (this.tweens.length == 0) { return true; } var currentTween = this.tweens[0]; if (!currentTween.active) { currentTween.start(); } var finished = currentTween.update(); if (finished) { this.tweens.splice(0, 1); } return false;};// TODO: COMBINED TWEENfunction CombinedTween(tweens) {}CombinedTween.prototype.start = function () {};CombinedTween.prototype.update = function () {}; I have created the following defintion file : /** * * Typescript declaration file for tween.js file * User: Marwane * Date: 09/04/15 */ declare var TWEEN: any;declare module TWEEN_ {export class Tween {object:any;property:string;targetValue:number;startValue:string;active:boolean;currentFrame:number;endFrame:number;tweens:any[]; constructor( object:any, property:string, value:number, frames:number, autostart:boolean); public onComplete:()=>void;public setOnComplete:()=>void;public start:()=>void;public initIterations:()=>void;public update:()=>void;public runTweens:()=>void;public noEase:()=>void;public outElastic:()=>void;public inElastic:()=>void;public inOutQuintic:()=>void;public inQuintic:()=>void;public outQuintic:()=>void;public inCubic:()=>void;public inOutCubic:()=>void;public outCubic:()=>void;} export class ChainedTween{tweens:any[]; constructor(tweens:any[]); public update:()=>void; } } it compiles, however when i run the code i get "Uncaught ReferenceError: TWEEN_ is not defined" Please help me Thanks in advance
  23. Hi, My name is Pete Schmitz and I'm a programmer that's available for HTML5 game development. I'm providing services that include porting games from Flash(AS3)/Java/C#/C++ to HTML5 applications that are mobile-compliant, optimizing/improving existing projects, and collaborating on entirely new applications. I have over six years experience in browser-based games development, which includes contract work for Nickelodeon and Newgrounds. My portfolio of published applications, including my resume and contact details, can be found at http://peteschmitz.com If you're interested in my services, please feel free to contact me - Either through this thread, PM, or my email (gpdevs [at] gmail [dot] com). I'd love to hear about your project and discuss how I can provide assistance with it. I currently reside near San Francisco, California (PDT). Thanks for your time, Pete
  24. Hi there, So for my final year project I decided to recreate Worms Armageddon in JavaScript (Well actually Typescript) Would be great if some people could play it, as its still only beta and buggy, but getting there. http://www.ciaranmccann.me/wormsjs/ Any comments and feedback would be very much appreciated Thanks