lars

Members
  • Content count

    31
  • Joined

  • Last visited

About lars

  • Rank
    Advanced Member

Contact Methods

  • Twitter
    @lgre63

Recent Profile Visitors

895 profile views
  1. Loader in Pandajs 2

    Ehh .... ok. No support of MP3 :-)
  2. Loader in Pandajs 2

    Only one thing: If I try to preload mp3 like: game.addMedia('sound/soundwaterdrop.*', 'water'); Errror: Uncaught Unsupported file format * or game.addMedia('sound/soundwaterdrop.mp3', 'water'); Error: Unsupported file format mp3 This happens in the updated 2.0 version: https://github.com/ekelokorpi/panda-engine/tree/develop/src Have been trying to look around in the Loader.js file ... but ... :-)
  3. Loader in Pandajs 2

    Hello Enpu So f...... nice to have you back :-) . It´s working now. Thanks a lot ... Heres how I did (just a dummy, with some stolen parts), and put a reference in the config.js file as you said :-) : game.config = { system: { width: 1024, height: 768, center: true, scale: true, loader: 'MyLoader' } }; And the dummy loader: game.module( 'game.main' ) .require( 'game.assets' ) .body(function() { this.bar; game.createClass('MyLoader', 'Loader', { onStart: function() { this.bar = new game.Graphics(); this.bar.beginFill('#ccc'); this.bar.drawRect(0, 0, 260, 40); this.bar.x = game.system.width / 2 - (260 / 2); this.bar.y = game.system.height / 2 - (40 / 2); this.bar.scale.x = this.percent / 100; this.bar.addTo(this.stage); }, onProgress: function() { console.log(this.percent); //console.log(this.sprite.x); this.bar.scale.x = this.percent / 100; }, onComplete: function() { game.system.setScene('Main'); } }); game.createScene('Main', { backgroundColor: '#666', init: function() { console.log('opo'); } }); });
  4. Loader in Pandajs 2

    I have tried with a panda 2 update version from: https://github.com/ekelokorpi/panda-engine/tree/develop/src And tried the following: game.module( 'game.main' ) .body(function() { game.addMedia('baggrund_level1.png','bb'); game.createScene('Main', { backgroundColor: '#666', init: function() { console.log('im started'); this.loader = new game.Loader(); this.loader.onStart = this.setGame.bind(this); this.loader.onProgress = this.setPercentGame.bind(this); this.loader.onComplete = this.loadingGame.bind(this); this.loader.start(); }, setGame: function() { console.log('Started'); }, setPercentGame: function() { console.log('percent'); }, loadingGame: function(){ var sprite = new game.Sprite('bb'); sprite.addTo(this.stage); } }); }); With the same result. No response from the onProgress listener.
  5. Loader in Pandajs 2

    And heres the file that starting the game with the loader: assets.js
  6. Loader in Pandajs 2

    Hello Enpu Yes I have a assets.js which holding the following: game.module( 'game.assets' ) .body(function() { game.addAsset('newgra/tastatur.jpg', 'tastatur'); game.addAsset('newgra/uden-tastatur.jpg', 'uden-tastatur'); game.addAsset('newgra/aeggeskilt.png', 'level1'); game.addAsset('newgra/aeggeskilt.png', 'level2'); game.addAsset('newgra/aeggeskilt.png', 'level3'); game.addAsset('newgra/forgrund.png', 'bord'); game.addAsset('newgra/baggrund.png', 'stribes'); game.addAsset('newgra/bg-himmel.jpg', 'heaven'); game.addAsset('newgra/baggrund_level1.png', 'baglevel1'); game.addAsset('newgra/baggrund_level2.png', 'baglevel2'); game.addAsset('newgra/baggrund_level3.png', 'baglevel3'); game.addAsset('newgra/rabbit.json'); game.addAsset('newgra/kylling.json'); game.addAsset('newgra/fox.json'); game.addAsset('newgra/smallchicken.json'); game.addAsset('newgra/chickenweapon.json'); game.addAsset('newgra/eggglow.json'); game.addAsset('newgra/eggglow_blue.json'); game.addAsset('newgra/eggglow_purple.json'); game.addAsset('newgra/plane.json'); game.addAsset('newgra/cheep.json'); game.addAsset('newgra/chickenbaloonfly.json'); game.addAsset('newgra/gennemfoert-lvl1.jpg', 'level1done'); game.addAsset('newgra/gennemfoert-lvl2.jpg', 'level2done'); game.addAsset('newgra/gennemfoert-lvl3.jpg', 'level3done'); game.addAsset('newgra/shitbullet.png', 'bullets'); game.addAsset('newgra/karamel.png', 'bigagurk'); game.addAsset('newgra/karamel_small.png', 'peachs'); game.addAsset('newgra/karamel2_small.png', 'peachs2'); game.addAsset('newgra/karamel3_small.png', 'peachs3'); game.addAsset('newgra/karamel4_small.png', 'peachs4'); game.addAsset('newgra/sun.json'); game.addAsset('newgra/eggs/aeg1-1.png', 'sam1'); game.addAsset('newgra/eggs/aeg1-2.png', 'sam2'); game.addAsset('newgra/eggs/aeg1-3.png', 'sam3'); game.addAsset('newgra/eggs/aeg-2-1.png', 'sam4'); game.addAsset('newgra/eggs/aeg-2-2.png', 'sam5'); game.addAsset('newgra/eggs/aeg-2-3.png', 'sam6'); game.addAsset('newgra/eggs/aeg3-1.png', 'sam7'); game.addAsset('newgra/eggs/aeg3-2.png', 'sam8'); game.addAsset('newgra/eggs/aeg3-3.png', 'sam9'); game.addAsset('newgra/eggs/aeg1-1-mini.png', 'sam1-mini'); game.addAsset('newgra/eggs/aeg1-2-mini.png', 'sam2-mini'); game.addAsset('newgra/eggs/aeg1-3-mini.png', 'sam3-mini'); game.addAsset('newgra/eggs/aeg-2-1-mini.png', 'sam4-mini'); game.addAsset('newgra/eggs/aeg-2-2-mini.png', 'sam5-mini'); game.addAsset('newgra/eggs/aeg-2-3-mini.png', 'sam6-mini'); game.addAsset('newgra/eggs/aeg3-1-mini.png', 'sam7-mini'); game.addAsset('newgra/eggs/aeg3-2-mini.png', 'sam8-mini'); game.addAsset('newgra/eggs/aeg3-3-mini.png', 'sam9-mini'); game.addAsset('newgra/button-left.png', 'jump'); game.addAsset('newgra/button-right.png', 'shooting'); game.addAsset('particle.png', 'particle'); game.addAsset('testfont.fnt'); game.addAudio('sound/waterdrop.*', 'water'); game.addAudio('sound/fruit.*', 'fruit'); game.addAudio('sound/newsound/baggrund_paaskespil.*', 'bb'); game.addAudio('sound/newsound/baggrund_paaskespil2.*', 'bb2'); game.addAudio('sound/newsound/baggrund_paaskespil3.*', 'bb3'); game.addAudio('sound/newsound/Fail_0.*', 'fail0'); game.addAudio('sound/newsound/Fail_1.*', 'fail1'); game.addAudio('sound/newsound/Fail_2.*', 'fail2'); game.addAudio('sound/newsound/done_level1.*', 'goal1'); game.addAudio('sound/newsound/done_level2.*', 'goal2'); game.addAudio('sound/newsound/done_level3.*', 'goal3'); game.addAudio('sound/newsound/first_course.*', 'hint4'); game.addAudio('sound/newsound/airplane.*', 'airplane'); game.addAudio('sound/newsound/sheep.*', 'sheepsound'); game.addAudio('sound/newsound/biplane.*', 'biplane'); game.addAudio('sound/newsound/collectegg.*', 'collectegg'); game.addAudio('sound/newsound/shoot.*', 'shoot'); game.addAudio('sound/newsound/shoot1.*', 'shoot1'); game.addAudio('sound/newsound/shoot2.*', 'shoot2'); game.addAudio('sound/newsound/fanfare.*', 'fanfare'); });
  7. Loader in Pandajs 2

    Hello everyone I´m having some issues with the Loader in Pandajs 2 When i do the following: this.loader.onStart = this.setGame.bind(this); this.loader.onComplete = this.loadingGame.bind(this); this.loader.start(); Everything is just fine: But when I try to make a onProgress the onProgress does not response: this.loader.onStart = this.setGame.bind(this); this.loader.onProgress = this.processGame.bind(this); this.loader.onComplete = this.loadingGame.bind(this); this.loader.start(); I can see it, and trace it in the Loader.js class : onProgress: function() { //console.log(this.percent); //if (this.barFg) this.barFg.scale.x = this.percent / 100; } Her is a simple implementation I done: game.module( 'game.start' ) .require( 'game.assets' ) .body(function() { game.createScene('Start', { backgroundColor: '#5ca282', init: function() { this.loader = new game.Loader(); this.loader.onStart = this.setGame.bind(this); this.loader.onProgress = this.processGame.bind(this); this.loader.onComplete = this.loadingGame.bind(this); this.loader.start(); }, //END init setGame: function() { console.log('started'); }, processGame: function() { console.log('percent'); }, loadingGame: function() { document.getElementById('loading').style.display = "none"; this.startContainer = new game.Container().addTo(this.stage); if (!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { this.mytastatur = new game.Sprite('tastatur').addTo(this.startContainer); } else { this.mytastatur = new game.Sprite('uden-tastatur').addTo(this.startContainer); } this.mytastatur.position.x = game.system.width / 2 - this.mytastatur.width / 2; this.mytastatur.position.y = 0; this.mytastatur.interactive = true; this.mytastatur.click = this.mytastatur.tap = this.changeScene.bind(this, "Main"); }, changeScene: function(go) { game.system.setScene(go); var playbg = game.audio.playMusic('bb', true); game.audio.setVolume(playbg, 0.2); }, }) //END Start }); Anybody knows what wrong with onProgress on the Loader. /Lars
  8. I'm back

    Enpu ... not Empu :-)
  9. I'm back

    Wellcome back Empu .. we missed you :-)
  10. Loader in pandajs 2

    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', )
  11. TilingSprite in Safari

    Problems with TilingSprite in Safari: Is there a work-around? See playground: http://ekelokorpi.github.io/panda.js-site/engine/playground/#tilingsprite_scroll
  12. Removing a body

    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 ... :-)
  13. addTimer and pause()

    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 :-)
  14. Global textcounter

    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()); }
  15. Global textcounter

    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;