-1
\$\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\$
0
\$\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/phaser-examples-assets@v2.0.0/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/phaser@3.17.0/dist/phaser.min.js"></script>

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.