Ad4m

Members
  • Content Count

    20
  • Joined

  • Last visited

Everything posted by Ad4m

  1. Ad4m

    Picture Packer

    Hi all, I would like to share here a simple python app I'm coding: PicPacker. It's -or will be someday- somehow similar to TexturePacker. It takes same sized images, processes them and yield, as you all has supposed, a single image containing all the others. Also if you specify it you can generate a json to index all images. If you like be my guess and try it, at least for testing purposes ☺️
  2. Ad4m

    Help with using the Phaser3 Framework

    Hey @Derail thanks for the answer, as a matter of facts these days I've been learning the Webpack's concepts and I already made my first steps with it. Several days ago I found that approach -like you said- but I didnt took a look at it due to I had never used a module bundler before, now I will do it. Webpack isn't that hard to understand even for a beginner like me in some aspects of programming. I think I will make a blog about all the things I will learn when learning phaser.
  3. Ad4m

    Help with using the Phaser3 Framework

    Hey @samme, sorry for the noob question but can you or someone else explain me a way to split the app.js into multiple files?
  4. Ad4m

    GameConfig

    Hi all, I'm wondering where can I find the game-configuration-object's description? I was browsing the docs here and, even if I don't know if it does have what I am looking for, when I clicked in the GameConfig param link, I got an 404 Error. So now I don't know where to look for. Can you help me understand the game config object?
  5. Ad4m

    GameConfig

    Thanks all for replying. Yes @michebn what I want i can find it at https://photonstorm.github.io/phaser3-docs/boot_Config.js.html#line-54 as you can see there's almost no description there and you have nothing here https://photonstorm.github.io/phaser3-docs/Phaser.Boot.Config.html . I was looking for something like @samme provide at https://photonstorm.github.io/phaser-ce/global.html#GameConfig but Phaser 3 not phaser-ce.
  6. Hi, i just found this post in a similar topic posted by @fariazz that was helpful to me. Thks anyway. MODs if you can delete this topic :)
  7. Greetings! I was some time ago learning Phaser 2 but for some reasons I had to stop doing it. Now I will start again from almost zero and I don't know what would be better to learn: the solid Phaser 2 or the new one with new features Phaser 3. Please give me some advice.
  8. @oobarbazanoo try creating the group of tiles this way group = game.add.physicsGroup(); i'm not sure if it's the same than: me.platforms = me.game.add.group(); me.platforms.enableBody = true; but try anyway
  9. Ad4m

    How to check [EASY]

    I'm not sure if this is the best approach but try this: this.game.physics.arcade.overlap(this.bullets, this.groupOfEnemies, this.bulletsColision, null,this); function bulletsColision(bullets, enemy) { console.log( this.groupOfEnemies.getIndex(enemy) ); }
  10. Ad4m

    Sprite size problems

    That worked perfectly @samme, i will take a look at what you said anyway @jonteferm. Thks both for the answer.
  11. Ad4m

    Sprite size problems

    I created a Texture Atlas using SpriteSheet Packer and I thoght it will crop the sprites but when i debug it showing the bounds i get what you can see in one of the pics attached, but when you look at the texture file the sprites are cropped, I dont know if that's a problem with frame dimensions in the json definition or not. Is there a way to do that without editing all the images to the proper dimensions?
  12. Ad4m

    Sprite size problems

    You can see what i meant above here https://n3s7or.github.io/DoGGer/
  13. Ad4m

    Try my flappy bird game

    It looks good as some has mentiones but i couldn't be able to score more than 3
  14. Ad4m

    Sprites animation & gen paint

    Hi, for those who want to create graphics faster and easyly using that simple tool called Gen-Paint, check out below this function i made that allows to create and add a spritesheet dynamically to our game cache using the arrays of pixel data generated in Gen-Paint. Just copy the function in your project, the function will be called using the line generated in the modified version of gen-paint attached (An example is also attached). function createSpriteSheet(gameObj, frames, spritesheet_name){ var id_base = "texture_base_id_"; var objs = {n:frames.arrFrames.length,width:null,height:null}; for (var x = 0; x < objs.n; x++){ frames.arrFrames[x] = gameObj.create.texture(id_base+x,frames.arrFrames[x],frames.fWidth,frames.fHeight,0); } objs.width = frames.arrFrames[0].width; objs.height = frames.arrFrames[0].height; var bitmap = gameObj.add.bitmapData(frames.fWidth * objs.n * objs.width,frames.fWidth * objs.height); var x = 0; for (var i = 0; i < objs.n ; i++){ bitmap.draw(id_base+i, x, 0); x += objs.width; } game.cache.addSpriteSheet(spritesheet_name, '', bitmap.canvas, objs.width, objs.width); } gen_paint_1.js example.html
  15. Hi everyone. I'm just startig to learn phaser and so gamedev programming. I've seen some tutorials about basic stuff in phaser and now I think I should make - or try to - an "easy" arcade game like Paratrooper. I was thinking to use silly graphics created like below. var frame0 = [ .... ]; var frame1 = [ .... ]; var frame2 = [ .... ]; this.game.create.texture('idle', frame0, 4, 4, 0); this.game.create.texture('walk1', frame1, 4, 4, 0); this.game.create.texture('walk2', frame2, 4, 4, 0); this.player = this.game.add.sprite(this.game.width/2, this.game.height/2, 'idle'); So ... my question here is how do do animations using the textures created like that, because this way i'll have 3 different images/sprites, not like in spritesheets or atlases. So far I haven't found a way to do that or i don't know if to do that can be possible.
  16. Ad4m

    Sprites animation & gen paint

    Browsing the site I found this thread http://www.html5gamedevs.com/topic/8258-create-animation-dynamically/, the author was looking for something similar, read it if you want, anyway one of the replies was so f.. helpful it almost has everything, i just need to do a few changes to my purpose. Basically what i did was create a spritesheet dynamically using the textures made by game.create.texture(), and then use it to create the animation. What we need to do is 1- Create the textures from the frames made using gen-paint. 2- Create the BitmapData Object (4 more info about it read the API docs) which will hold the spritesheet 3- Draw the sprites in the BitmapData object and add it to the cache 4- Create the player, animations, ...... See the file attached containing the whole example walking_guy.js
  17. Ad4m

    Sprites animation & gen paint

    I see your point squilibob, but when i added the two functions and called them ir rises an error ReferenceError: FrameData is not defined. Besides this i'm not sure about one thing the third parammeter received by createAnimation(animationName, playerName, frameName) and then passed to createFrameData(frameName) isnt a frame but an array of characters. The code below is what i have so far for testing purposes. There it's shown the four textures and you can move one located in the middle of the screen. var game = new Phaser.Game(400, 300, Phaser.AUTO, '', { init : init, create : create, update : update}); // Frames var frame0 = [ // idle '.....33333......','....3333333.....','.....7D7D7......','....6777776.....', '.....77477......','......222.......','....2222222.....','....7222227.....', '....7222227.....','....7222227.....','....7001007.....','....7DDDDD7.....', '....76D.D67.....','.....DD.DD......','.....DD.DD......','.....55.55......']; var frame1 = [ // walk1 '.....3333.......','.....333333.....','....6667D7......','....6767777.....', '.....7777.......','.....222........','....2222........','....72222.......', '...677222.......','..76.2722.......','.....0070.......','.....DD.D.......', '....DDD.DD......','..5DDDD.DDD.5...','...5DDD.DDD5....','....55...55.....' ]; var frame2 = [ // walk2 '.....3333.......','.....333333.....','....6667D7......','....6767777.....', '.....7777.......','......222.......','.....22222......','.....722227.....', '.....722227.....','.....722227.....','.....70000......','.....7DDDD......', '......DDDD......','......DDDD......','......5..5......','......55.55.....']; var frame3 = [ //walk3 '.....3333.......','.....333333.....','....6667D7......','....6767777.....', '.....7777.......','.....222........','....222277......','...77222277.....', '...7.2222.77....','..7..2222.......','.....0000.......','.....DDDD.......', '....DDD.DD......','..5DDDD.DDD.5...','...5DDD.DDD5....','....55...55.....']; // ----------------------------- // Declaration var player = null; var cursor = null; // Phaser functions function init() {game.scale.pageAlignHorizontally = true; } function create(){ game.physics.startSystem(Phaser.Physics.ARCADE); cursor = game.input.keyboard.createCursorKeys(); // Show three textures on the screen 4 demonstration purpose var style = { font: "14px Arial", fill: "#ff0044", align: "center" }; var text = game.add.text(10, 10, "Textures created:", style); text_idle = game.create.texture('idle', frame0, 4, 4, 0); text_walk1 = game.create.texture('walk1', frame1, 4, 4, 0); text_walk2 = game.create.texture('walk2', frame2, 4, 4, 0); text_walk3 = game.create.texture('walk3', frame3, 4, 4, 0); game.add.sprite( 10, 30, 'idle' ); game.add.sprite( 60, 30, 'walk1' ); game.add.sprite( 110, 30, 'walk2' ); game.add.sprite( 160, 30, 'walk3' ); //------------------------- // Here goes the how to do animation player = game.add.sprite(game.world.centerX, game.world.centerY, 'idle'); player.anchor.setTo(0.5); //------------------------- game.physics.arcade.enable(player); player.body.collideWorldBounds = true; } function update() {movePlayer();} //---------------- // Other functions function movePlayer() { if (cursor.right.isDown) { player.body.velocity.x = 180; // Animation } else if (cursor.left.isDown) { player.body.velocity.x = -180; // Animation mirrored } else { player.body.velocity.x = 0; } }
  18. Ad4m

    Learn Phaser for beginners! (Spanish)

    hola, veo que hace ya dos años no actualizan este hilo, me gustaria saber la situacion actual de los tutoriales para personas de habla hispana hi, i can see this thread hasnt been updated since almost 2 years now, i'd like to know the current state of tutorials for spanish speakers