dthrasher90

cant seem to get sprite to load

Recommended Posts

Any help??

  var game = new Phaser.Game(800, 600, Phaser.AUTO);
            var GameActionState  = {
               preload: function(){
                  game.load.image('field', 'assets/field.png');
                  game.load.image('wr1', 'assets/reddot.png');
                  game.load.image('wr2', 'assets/reddot.png');
                  game.load.image('wr3', 'assets/reddot.png');
                  game.load.image('wr4', 'assets/reddot.png');
                  game.load.image('qb', 'assets/reddot.png');
                  game.load.image('football','assets/football.png');
                  game.load.image('button', 'assets/button.jpg');
                  game.load.spritesheet('player', 'assets/player2.png',61, 70, 16);
                },

                create: function(wr1){

                game.physics.startSystem(Phaser.Physics.ARCADE);
                game.physics.arcade.enable(wr1, wr2, wr3, wr4, football);


                var player= game.add.sprite(300, 300,'player');

 

Share this post


Link to post
Share on other sites

are you getting any specific errors in console ? I can't see how you're actually using the  GameActionState ?

The above code isn't enough for investigating your issue , can you either post more code or make a simple jsfiddle example so we can see all the code? 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.