Zeephaser

Members
  • Content count

    17
  • Joined

  • Last visited

About Zeephaser

  • Rank
    Member
  • Birthday 04/09/1999

Contact Methods

  • Twitter
    Zee__MS

Profile Information

  • Gender
    Male
  • Location
    Nigeria
  • Interests
    Reading,programming....
  1. Thanks very much, it works perfectly
  2. the texts created in the ridFactory() and valInput() functions don't update but is rendered on top of the previous ones, I don't know what's wrong. Please help create:function(){ this.input=this.game.add.inputField(10,200,{ font: '18px Arial', fill: '#212121', fontWeight: 'bold', width: 150, padding: 8, borderWidth: 1, borderColor: '#000', borderRadius: 6, cursorColor: 'red' }); //parse and add json file to cache this.riddles=this.game.cache.getJSON("riddles"); //assign array in json files to rArray this.rArray=this.riddles.rArr; this.game.stage.backgroundColor="#ff3399"; //create riddles here this.ridFactory(); this.valButton=this.game.add.button(this.game.world.width*0.5,this.game.world.height*0.5,'button',this.validateInput,this); this.valButton.anchor.setTo(0.5); //this.cursors=this.game.input.keyboard.createCursorKeys(); }, update:function(){ }, ridFactory:function(){ //var for holding current riddle this.currRid=Phaser.ArrayUtils.removeRandomItem(this.rArray); this.style={font:"40px Arial",fill:"#fff",align:"center"}; this.ridText=this.game.add.text(0,0,this.currRid.riddle,this.style); }, validateInput:function(){ var gameMessage=""; if(this.input.value==''){ this.gameMessage = this.game.add.text(0,400,"input text",this.style); } else{ if(this.input.value!==this.currRid.answer){ this.gameMessage = this.game.add.text(this.game.world.width*0,this.game.world.height*0.75,"you are wrong",this.style); this.ridFactory(); } else{ this.gameMessage = this.game.add.text(this.game.world.width*0,this.game.world.height*0.75,"you are correct",this.style); } this.ridFactory(); } } }; game.state.add("main",mainState); game.state.start("main");
  3. thanks guys!, already got texturepacker and spriter. Will check the others out
  4. Oh that's great, plan to download Inkscape soon. BTW is there any lightweight alternative to Inkscape. sorry for asking, data is a little expensive where I'm from
  5. Hey guys, please can someone point me to a good 2d art tool for phaser which I can use to create sprites, deal with spritesheets and so on, and also have good phaser support. P. S Can I use Inkscape to create sprites for phaser
  6. I decided to go with Tiled, thanks guys!
  7. I mean any software that uses canvas or SVG, similar to Inkscape but more lightweight
  8. Hey guys does anyone know guides or tutorials for level design in phaser without using Tiled? And maybe a software that uses SVG or canvas as art.I'm into sidescrollers but not so into Tiled stuff.
  9. I found the mistake guys, I preloaded the images with assignment syntax, I forgot it was a method. game . load. image = xxxx; instead of game. load. image (xxxx) ;
  10. thanks
  11. Sorry how do I do that
  12. Yeah they're all in the right folder I'm the root. I didn't make an assets folder so...
  13. Hey guys I'm new to phaser and I'm testing it out with a simple example, I've run into a problem where my sprites are rendered as black boxes it doesn't matter what sprite I load they all come out as boxes. I don't understand what's happening please help me. Here's my code : var game=new Phaser.Game(900,800,Phaser.AUTO,"gamediv"); var mainstate={ preload:function(){ game.load.image("circle","circle.png"); game.stage.backgroundColor="00feff"; }, create:function(){ game.physics.startSystem(Phaser.Physics.ARCADE); this.hellosprite=game.add.sprite(20,300,"circle"); game.physics.arcade.enable(this.hellosprite); this.hellosprite.body.gravity.y=1000; this.hellosprite.body.collideWorldBounds=true; this.hellosprite.body.bounce.y=0.6; this.cursors.game.input.createCursorKeys(); }, update:function(){ this.hellosprite.body.velocity.x+=1 if(this. hellosprite. body. velocity.x>=30) { this. hellosprite. body. velocity. x=0; } } }; game.state.add("main",mainstate); game.state.start("main");
  14. OK thanks so much, what I actually meant was what config-dev.js used for sorry but thanks now I get it
  15. And what do I need to edit config-dev. js for? Sorry if I sound dumb I'm a noob