Jump to content

Image read in console text/html


reegankens
 Share

Recommended Posts

I'm sory about my english before.

 

first of all I try to download Wants Candy Monster assets of gi. after that I tried to run in localhost initially all was fine. but when I downloaded my pictures from google and put the picture in the folder img, then I load images from preloade. then the picture I call on the create function, after that I tried to run but instead the picture does not appear. after that I tried to check my pictures teryata console extension of his recognizable as text / html.

 

can anyone explain to me why it could happen ?

 

post-15095-0-93128600-1434952591.jpg

 

Preloader :

Candy.Preloader = function(game){
// define width and height of the game
Candy.GAME_WIDTH = 640;
Candy.GAME_HEIGHT = 960;
};
Candy.Preloader.prototype = {
preload: function(){
// set background color and preload image
this.stage.backgroundColor = '#B4D9E7';
this.preloadBar = this.add.sprite((Candy.GAME_WIDTH-311)/2, (Candy.GAME_HEIGHT-27)/2, 'preloaderBar');
this.load.setPreloadSprite(this.preloadBar);
// load images
this.load.image('background', 'img/background.png');
this.load.image('floor', 'img/floor.png');
this.load.image('monster-cover', 'img/monster-cover.png');
this.load.image('title', 'img/title.png');
this.load.image('game-over', 'img/gameover.png');
this.load.image('score-bg', 'img/score-bg.png');
this.load.image('button-pause', 'img/button-pause.png');
this.load.image('images-s','img/images-s.png')
// load spritesheets
this.load.spritesheet('candy', 'img/candy.png', 82, 98);
this.load.spritesheet('monster-idle', 'img/monster-idle.png', 103, 131);
this.load.spritesheet('button-start', 'img/button-start.png', 401, 143);
},
create: function(){
// start the MainMenu state
this.state.start('MainMenu');
}
};
 
create function :
Candy.Game.prototype = {
create: function(){
// start the physics engine
this.physics.startSystem(Phaser.Physics.ARCADE);
// set the global gravity
this.physics.arcade.gravity.y = 200;
// display images: background, floor and score
this.add.sprite(0, 0, 'background');
this.add.sprite(-30, Candy.GAME_HEIGHT-160, 'floor');
this.add.sprite(10, 5, 'score-bg');
this.add.sprite(0, 0, 'images-s.png');
// add pause button
this.add.button(Candy.GAME_WIDTH-96-10, 5, 'button-pause', this.managePause, this);
// create the player
this._player = this.add.sprite(5, 760, 'monster-idle');
// add player animation
this._player.animations.add('idle', [0,1,2,3,4,5,6,7,8,9,10,11,12], 10, true);
// play the animation
this._player.animations.play('idle');
// set font style
this._fontStyle = { font: "40px Arial", fill: "#FFCC00", stroke: "#333", strokeThickness: 5, align: "center" };
// initialize the spawn timer
this._spawnCandyTimer = 0;
// initialize the score text with 0
Candy._scoreText = this.add.text(120, 20, "0", this._fontStyle);
// set health of the player
Candy._health = 10;
// create new group for candy
this._candyGroup = this.add.group();
// spawn first candy
Candy.item.spawnCandy(this);
},

 

Link to comment
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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...