• Content Count

  • Joined

  • Last visited

About Tixxi

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Tixxi

    phaser editor yes or not?

    I found that using Phaser Editor really helped me make my first game in Phaser 2. I then switched over to Phaser 3 and had to go through it without the editor, and I am kinda glad I did. I now understand how it all works a bit better. With that being said though, when Phaser Editor comes out for Phaser 3, I will probably purchase and use it just because anything that makes my work go faster is a good thing for me. And designing levels using just the code took me waaaaay too long!
  2. Hey all! Basically finished my first Phaser 3 game!! I am super happy to have finally gotten it working. Thanks to everyone here who gave me assistance along the way! This is Bleepy's Gifts - a multiplication game for kids. It is a duplicate of a game I made in Flash years ago. Currently, for testing, I only made each level have 2 customers, so should only take 3 mins to play through. https://fun4thebrain.com/phaserGames/p3bleepy/ Please let me know if it loads super slowly or doesn't work for any of you.
  3. Tixxi

    Trying to get Animation to go to random frame

    OK!! I figured out what I was doing wrong. Being new to Phaser 3, I did not understand how very simple it was to change the texture of an image! So, instead of making the items into animations that I wanted to show just one frame at a time, I simply changed the texture of an image. I realize that this may have been clear to more experienced Phaser 3 users, but I figured for other newbies like me, I would put up how I ended up doing it. First, I set up some arrays holding all the names of the images. var outfitList = ['overalls10001.png', 'overalls10002.png', 'overalls10003.png', 'overalls10004.png', 'overalls10005.png']; Then I created a random number and assigned the image "outfits" to switch out the current graphic with the newly listed one using the setTexture function. var randomOutfit = Math.floor(Math.random() * outfitList.length); outfits.setTexture('bparts', outfitList[randomOutfit]); I don't know if this was the 'correct' way to do this, but it was what I came up with. Originally, I was using the 'this.anims.generateFrameNames' because I have many of these items that will be randomized and thought it was an easier way to pull out their names without having to make some lengthy arrays. But, this way, while taking more typing, is clean and easy. So, thanks for everyone's help. The problem has been solved! Apparently, using the right tool for the job makes things better!
  4. Tixxi

    Trying to get Animation to go to random frame

    Unfortunately, I still can't get this to work. Maybe I will have to make a different game.
  5. Tixxi

    Trying to get Animation to go to random frame

    Didn't work Got this error when I put in outfits.setCurrentFrame(4): TypeError: outfits.setCurrentFrame is not a function
  6. OK. So, I am making a game and there is a robot that comes into the scene, and each time he does, he has on a different outfit. There is a container (robotContainer) holding a body, outfit, glasses, and hair. I cannot seem to figure the way to tell the outfit, hair, and glasses to go to a random frame. I have tried setFrame() and setTexture() and both give me the error: TypeError: e is undefined or claims that outfits.setTexture is not a function. Here is the code that I have used to set up the body. Later, the randomization will be happening from inside of a tween, but if I can't get it to work in the main create function, then it won't work from a tween either. As you look at the code, please realize that I am fairly new to this So, I am hoping someone can tell me the tiny thing that I am missing to make it so I can reference the frames in these animations and then I can tell it to go to a random frame at the beginning of the robotContainer tween. Thanks for any help you can give. robotContainer = this.add.container(960, 300); robotContainer.name = 'RC'; robotBody = this.add.sprite(0, 0, 'bparts', 'robotBody.png'); outfits = this.add.sprite(0, 45, 'bparts', 'overalls10001.png'); robotEyewear = this.add.sprite(-10, -80, 'bparts', 'glasses1.png'); robotHair = this.add.sprite(-10, -10, 'bparts', 'mustache1.png'); robotGift = this.add.sprite(0, 0, 'bparts', 'gifts0001.png'); //add robot parts to container for control robotContainer.add(robotBody); robotContainer.add(outfits); robotContainer.add(robotEyewear); robotContainer.add(robotHair); // set up the remaining frames of items var robotOutfit = this.anims.create({ key: 'RO', frames: this.anims.generateFrameNames('bparts', { prefix: 'overalls1', start: 1, end: 5, zeroPad: 4, suffix: '.png'})}); robotHair = this.anims.create({key: 'hairs', frames: this.anims.generateFrameNames('bparts', { prefix: 'mustache', start: 1, end: 8, suffix: '.png'})}); robotEyewear = this.anims.create({key: 'glasses', frame: this.anims.generateFrameNames('bparts', {prefix: 'glasses', start: 1, end: 3, suffix: '.png'})}); var moreClothes = this.anims.generateFrameNames('bparts', {prefix: 'jacket2', start: 1, end: 8, zeroPad: 4, suffix: '.png'}); outfits = this.anims.get('RO'); //put robotOutfit frames in outfits outfits.addFrame(moreClothes); //also add moreClothes frames in outfits console.log(outfits.frames); //lists all 10 frames from robotOutfit and moreClothes outfits.setFrame(4); //e is undefined
  7. Tixxi

    Multiatlas JSON errors

    That worked!!! It still didn't find my image at first, but then I put in the latest version of phaser.min.js, and it worked liked a charm. I must have copied an older version before. Thanks so much! You rock!!!!
  8. Tixxi

    Multiatlas JSON errors

    Hi all. I am basically a noob here and could really use some help on this. I created a multiatlas in Texture Packer. I followed the tutorial, and there is no rotation involved. Both the json file and the image files are located inside my assets folder. As instructed (in TP tutorial), I used this format to load it in my preload function: this.load.multiatlas('bb3', 'assets/bleepBacks.json', "assets") When I do this, I get the error... SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data If I take off the "assets" portion as I have seen done in a different forum, like so: this.load.multiatlas('bb3', 'assets/bleepBacks.json') Then, I do not get that error, but it can never find any of my files when I attempt to create them with the following line of code in my create function. this.add.sprite(400, 300, 'bb3', 'spaceBG2.png'); I have had no issues with loading separate single atlas files and finding the images. It is just with the multiatlas. Any help would be great. I have attached the json file in case there is some error there, but it was made with TexturePacker, so I am assuming the error is with my code somewhere. Thanks. bleepBacks.json
  9. Tixxi

    Can't call a function!

    Hahaha I did not realize that the numbers didn't come over. Sorry about that. And, yes, it was arraysChosen that was the problem. I finally got that fixed by changing it to this.arraysChosen(); and then the function was just arraysChosen()... Can't believe it took me like 3 hours to just make a function call. Hopefully it picks up speed now! Thank you so much for the Sublime packages! You rock!!
  10. Tixxi

    Can't call a function!

    I am just starting with Phaser and figured I should learn 3 instead of an earlier version. I have created a game, called in a scene, but can't seem to call a simple function. I have made tons of games in Actionscript, so am hoping to make this transition to Phaser easily. I am probably missing something basic or have screwed up something since I am going from 4 different tutorials. lol Any help would be great! When I run this, it gets to line 28 and then says SyntaxError: bad method definition. Help! Oh,... and while I have your attention... Anyone have a particular package for Sublime that helps with Phaser or Javascript? class FactChoice extends Phaser.Scene { constructor() { super({key:"FactChoice"}); } preload() { this.load.image('0', 'assets/images/numbers/0.png'); this.load.image('1', 'assets/images/numbers/1.png'); this.load.image('2', 'assets/images/numbers/2.png'); this.load.image('3', 'assets/images/numbers/3.png'); this.load.image('4', 'assets/images/numbers/4.png'); this.load.image('5', 'assets/images/numbers/5.png'); this.load.image('6', 'assets/images/numbers/6.png'); this.load.image('7', 'assets/images/numbers/7.png'); this.load.image('8', 'assets/images/numbers/8.png'); this.load.image('9', 'assets/images/numbers/9.png'); this.load.image('next', 'assets/images/btnNextLevel.png'); this.load.image('BG', 'assets/images/sky.png'); } create() { console.log("time to make FactChoice"); arraysChosen(); } arraysChosen: function(){ console.log("hey"); } }