Recommended Posts

Hi, I'm new to this whole phaser thing, and I looked around for an answer to my question, but here I am. Here is the github project that I am working on.


In my main.js file, which I have in the root directory of the project, I load the images as follows:

// Load the imagesfunction preload(){  game.load.image('background', 'TagJam18/images/Background.png')  game.load.image('platform', 'TagJam18/images/Platform.png')  game.load.image('Wall', 'TagJam18/images/Wall.png')    // Sprite sizes are inconsistent so there is no way to do these with constants  // The only real way is to resize the window sprite.  // I definiitely do not feel like doing that.  game.load.spritesheet('dog', 'images/DogSprite.png', 16, 8)  game.load.spritesheet('window', 'images/WindowSprite.png', 16, 16)}

Then in my create function I try to load my image.

// Create the scenefunction create(){  // Physics is a perfectly fine way to do things for this.  // The ARCADE engine has all the physics we need for a simple platformer  game.physics.StartSystem(Phaser.Physics.ARCADE)    // Add in the background.  game.add.sprite(ORIGIN, ORIGIN, 'background')

However, when I try to run my game, what I get is a black screen.


Am I doing something wrong with my folder directories?


I have all of my images in an image folder inside of the TagJam18 folder. I'm not very confident that I am referencing them correctly.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.