lars

Members
  • Content count

    24
  • Joined

  • Last visited

About lars

  • Rank
    Member

Contact Methods

  • Twitter
    @lgre63

Recent Profile Visitors

581 profile views
  1. Enpu ... not Empu :-)
  2. Wellcome back Empu .. we missed you :-)
  3. Hello everyone Hope someone could help me with the following: this.loader = new game.Loader(); this.loader.onComplete = this.loaded.bind(this); this.loader.onProgress=this.onProgress.bind(this); this.loader.start(); Its the onProgress which not is working. I´ll tried: this.loader.onProgress(this.onProgress.bind(this)); Heres how i call my assets: game.module( 'game.main' ) .require( 'game.assets', 'game.objects', 'game.settings', 'game.start', 'game.level2', )
  4. Problems with TilingSprite in Safari: Is there a work-around? See playground: http://ekelokorpi.github.io/panda.js-site/engine/playground/#tilingsprite_scroll
  5. Hey Having trouble removing my body from an event game.createClass('ChristmasPackage', { init: function(myimg,myscale) { var myPumkingsVelocityArray = [100, 80, 60, 50, 40, 32, 45, 67, 78, 98, 90]; var pumkingVInterval = myPumkingsVelocityArray[Math.floor(Math.random() * myPumkingsVelocityArray.length)]; var x = Math.random(16, game.system.width); this.pumkins = new game.Sprite(myimg); this.pumkins.interactive=true; this.pumkins.anchor.set(0.5, 0.5); this.pumkins.scale.set(myscale, myscale); this.body = new game.Body({ position: { x: x, y: -this.pumkins.height }, velocity: { x: 0, y: pumkingVInterval }, collisionGroup: 1, collideAgainst: [0], mass: 0, }); this.body.collide = this.collide.bind(this, myimg); var shape = new game.Rectangle(90, 90); this.body.addShape(shape); game.scene.stage.addChild(this.pumkins); game.scene.world.addBody(this.body); game.scene.addObject(this); This is the function where i try to remove the body this.pumkins.click = this.pumkins.tap = function(e) { game.scene.world.removeBody(); //this.body.remove(); };//function end }Can anyone help me here ... :-)
  6. I have the following: this.countDownText = new game.PIXI.Text("allo", { font: '40px Verdana',fill:'white'}); this.countDownText.position.set(20, 10); this.stage.addChild(this.countDownText); this.ShootTimer = game.scene.addTimer(1000, this.countdown.bind(this), true); this.countdown(); and try to pause ShootTimer when it´s meets a condition: countdown: function() { if(this.countingDown < 50){ this.ShootTimer.pause(); console.log("im there");//dette virker } this.countingDown --; this.countDownText.setText(this.countingDown.toString()); }But it does not pause. Any ideas :-)
  7. Sorry found a solution: this.scoreText = new game.PIXI.Text("allo", { font: '60px Verdana' }); this.scoreText.position.set(game.system.width - 20, 10); this.addScore(0); this.stage.addChild(this.scoreText); }, addScore: function(amount) { this.score += amount; this.scoreText.setText(this.score.toString()); }
  8. Hello A simple Q: How can i make at globla reference to a text: I tryed to put this in my main scene: this.myCountdown = new game.PIXI.Text("allo", { font: '60px Arial' });this.stage.addChild(this.myCountdown);this.myCountdown.text="hello test"; So I would like to refer to it in another obejct: this.myCountdown.text=counter;
  9. Hey enpu Thank´s a lot for the answer. Have tried to update to v2. that gave me some trouble with the fromeFrame texture: this.sprite = game.Animation.fromFrames('stand'); this.sprite.animationSpeed = this.speed; this.sprite.anchor.set(0.5, 0.5); this.sprite.play(); this.runTextures = this.sprite.textures; this.moveUpTextures = [game.Texture.fromFrame('ninjaup.png')]; this.moveLeftTextures = [game.Texture.fromFrame('ninjaleft.png')]; this.moveRightTextures = [game.Texture.fromFrame('ninjaright.png')];did´t know how to solve this ... have tried to install pandatool 1.12.3 and that did it... yahhhhhiii ... Thank´s alot ... Pandajs rules ...
  10. Ok so far i have installed node.js and installed panda tool: $ sudo npm install -g pandatool and when I try to build with $ panda build I get the following error: Building project... /Applications/MAMP/htdocs/ninjaalien/src/game/.DS_Store:1 (function (exports, require, module, __filename, __dirname) { SyntaxError: Unexpected token ILLEGAL at exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:414:25) at Object.Module._extensions..js (module.js:442:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:311:12) at Module.require (module.js:366:17) at require (module.js:385:17) at Object.module.exports.exports [as build] (/usr/local/lib/node_modules/pandatool/build.js:62:9) at Object.<anonymous> (/usr/local/lib/node_modules/pandatool/panda.js:7:17) at Module._compile (module.js:435:26)
  11. I have tried to upload a simple demo of a game I have made. It says the it´s cant find the game.min.js: game.min.js Failed to load resource: the server responded with a status of 404 (Not Found) I haven¨t minified or packed the game (dont know how in panda) I would appreciate if someone could lead me in the right direction :-) I would appreciateI would appreciate I would appreciate I would appreciate
  12. Is there a way to say to a body: When I´m hit (collision detected) remove the collision detection. I starting a spritesheet animation whichs live in the hitted objects and the collision seems to continue when it´s still is colliding with a object. Or should I use at seperate sprite animation which´s is called when to object collide.
  13. Solution: Adding a timer ... before remove ... found in Spaceshooter Example ... collide: function() { this.pumkins.textures = this.poffedPumkins.textures; this.pumkins.currentFrame = 0; //In this case just run it once this.pumkins.loop = false; this.pumkins.onComplete = function() { console.log("allo"); this.pumkins.visible = false; game.scene.addTimer(0, function() { this.remove();}.bind(this)); }.bind(this); },
  14. Sorry did´nt say what error there was now: this.pumkins.onComplete is not a function
  15. Thank´s a lot for the answer Hhmmm. That did not do it :-) Im a little bit confused about the bind method ... here is the class im working on. I would be very thankful if you have the time to have a look: game.createClass('Pumpkins', { init: function() { var myPumkingsVelocityArray=[100,80,60,50,40,32,45,67,78,98,90]; var pumkingVInterval = myPumkingsVelocityArray[Math.floor(Math.random()*myPumkingsVelocityArray.length)]; var x = Math.random(16, game.system.width); //this.pumkins = new game.Sprite('pumkings'); this.pumkins = new game.Animation('media/pumkings.png'); this.pumkins .animationSpeed = 0.3; this.pumkins .position.set(230, 350); this.pumkins.anchor.set(0,1); this.pumkins.play(); this.poffedPumkins = new game.Animation( 'media/pum1.png', 'media/pum2.png', 'media/pum3.png', 'media/pum4.png', 'media/pum5.png' ); this.pumkins.anchor.set(0.5, 0.5); this.body = new game.Body({ position: { x: x , y: - this.pumkins.height }, velocity: { x: 0, y: pumkingVInterval }, collisionGroup: 1, collideAgainst: [0], mass: 0, }); this.body.collide = this.collide.bind(this); this.body.addShape(new game.Rectangle(20, 20)); game.scene.addObject(this); game.scene.world.addBody(this.body); game.scene.stage.addChild(this.pumkins); this.update(); }, collide: function() { this.pumkins.textures=this.poffedPumkins.textures;this.pumkins.currentFrame=0;//In this case just run it oncethis.pumkins.loop=false; //this.remove(); this.pumkins.onComplete(this.remove.bind(this)); // this is the one i have been trying before /* this.pumkins.onComplete = function(){ this.remove(); }; */ }, update: function() { this.pumkins.position.x = this.body.position.x; this.pumkins.position.y = this.body.position.y; if (this.pumkins.position.y - this.pumkins.height / 2 > game.system.height) this.remove(); //this.body.position.x += 50 * game.system.delta; }, remove: function() { game.scene.removeObject(this); game.scene.world.removeBody(this.body); game.scene.stage.removeChild(this.pumkins); } });