Jump to content

Search the Community

Showing results for tags 'game.system.delta'.

  • 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 Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

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 1 result

  1. Hello guys, I'm trying to get this code working: game.module( 'game.main').require( 'engine.core').body(function() { game.addAsset('box.png'); eNemies = game.Class.extend({ init: function(vel, px){ this.containerEnemies = new game.Container(); this.containerEnemies.addTo(game.scene.stage); this.sprite = new game.Sprite('box.png',px,500,{anchor: { x: 0.5, y: 0.5 }}); this.sprite.interactive=true; this.sprite.addTo(this.containerEnemies); this.sprite.touchstart = this.sprite.click = function(){ this.remove(); } }, update: function(){ if(game.system.paused != true){ speedRandom = Math.floor(Math.random() * 280) + 100; this.sprite.position.y -= speedRandom * game.system.delta; } }, remove: function(){ game.scene.removeObject(this); } });game.createScene('Main', { backgroundColor: 0x44cce2, init: function() { eNemiesArray = []; i = 0; createEnemies = function(){ posXrandom = Math.floor(Math.random() * 500) + 1; this.eNemiesArray[i]=new eNemies(120,posXrandom); i++; setTimeout("createEnemies();", 250); } createEnemies(); }, });Enemies creation is working, enemies onTouch event also, but the update function, to move every enemies seems to not work, can you help me to understand what's wrong? Thank you
×
×
  • Create New...