0
\$\begingroup\$

Please can somebody help me as I'm a lil bit new to game dev and user interface designing. I am trying to create a simple Texas holdem poker using phaser3 for multiplayer application. I have a few doubts this is my app.js

   const config = {
  type : Phaser.AUTO,
  width : 800,
  height : 600,
  backgroundColor : #000000,
  physics : 'arcade',
  scene : {
    preload : preload,
    create : create,
    update : update

}, }

var game = Phaser.Game(config);

What is actually happening in this code and what should be my project folder structure for any simple multiplayer online game. Can I set the witdh and height dynamically depending on the device width and orientation??.

Please anybody who could just explain me a few things about gamedev...

Thanks in advance.

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

First of all the code you have shared is able to display a sprite which is the name of an image you can play with in game developpement or an element of the game, like the code bellow, so if you want to ask some questions first about this snippet please you're welcome, then we can for example discuss about the basic tutorial to create a game with Phaser 3

var config = {
    type: Phaser.AUTO,
    parent: 'phaser-example',
    loader: {
      baseURL: 'https://cdn.jsdelivr.net/gh/samme/[email protected]/assets/',
      crossOrigin: 'anonymous'
    },
    width: 800,
    height: 600,
    scene: {
      preload: preload,
      create: create
    }
};

var game = new Phaser.Game(config);

function preload ()
{
  this.load.image('dude', 'sprites/phaser-dude.png')
}

function create () 
{
  var sprite = this.add.sprite(50, 50, 'dude')
}
<script src="//cdn.jsdelivr.net/npm/[email protected]/dist/phaser.min.js"></script>

\$\endgroup\$
3
  • \$\begingroup\$ Thanks for the answer and sure I want some help \$\endgroup\$ Commented Jun 15, 2019 at 3:17
  • \$\begingroup\$ I read the basic tutorial but it's a lil bit confusing \$\endgroup\$ Commented Jun 15, 2019 at 3:18
  • \$\begingroup\$ What does confuse you ? \$\endgroup\$ Commented Jun 15, 2019 at 21:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .