Jump to content

Search the Community

Showing results for tags 'multidimensional array'.

  • 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. I am trying to create a simple Multidimensional array that will add a sprite to the spot example [0,0] I was following how this http://www.joshmorony.com/how-to-create-a-candy-crush-or-bejeweled-game-in-phaser/ was doing by doing something similar like: this.tileGrid = [ [null, null, null, null, null, null], [null, null, null, null, null, null], [null, null, null, null, null, null], [null, null, null, null, null, null], [null, null, null, null, null, null], [null, null, null, null, null, null] ]; but all I want is being change those position in the grid to sprite and none of the animation just simply to be there. addTileItem: function(x, y){ //Choose a random tile to add var tileToAdd = this.tileTypes[1]; //Add the tile at the correct x position, but add it to the top of the game (so we can slide it in) var tile = this.tiles.create((x * this.tileWidth) + this.tileWidth / 2, 0, tileToAdd); //Animate the tile into the correct vertical position this.game.add.tween(tile).to({y:y*this.tileHeight+(this.tileHeight/2)}, 500, Phaser.Easing.Linear.In, true) //Set the tiles anchor point to the center tile.anchor.setTo(0.5, 0.5); //Enable input on the tile tile.inputEnabled = true; //Keep track of the type of tile that was added tile.tileType = tileToAdd; //Trigger the tileDown function whenever the user clicks or taps on this tile tile.events.onInputDown.add(this.tileDown, this); return tile; }, I think I am overthinking the problem but I been at this for a while any help would be greatly appreciated.
×
×
  • Create New...