n7pankake

Members
  • Content count

    16
  • Joined

  • Last visited

  1. Hello, just ran into a problem on my game I made some SPAWN areas for my enemies (4) but every time I try them to make like a chase function I ran into an error, this is what I got: Any ideas? thanks (is a TILED OBJECT LAYER, not even sure if this is possible but it should (I think))
  2. Delays in Phaser

    Hello, Just wanted to know, is there a way to create a delay that acts instantly and without functions like for example I want to create wave of enemies, if is wave 1 it creates 4 if is wave 2 it creates 8 and so on, I finish the logic BUT I want to have some delay (because the spawn place is exactly the same) and lets say we are in wave 5 ... I will get 4 enemies in the same position and I will like to wait like ... 3 seconds between creation here is what I got so far.
  3. How to add delays in Phaser?

    can you add a delay WITHOUT Needing a damn function/event?
  4. problem with .damage oneshots

    I did try to do that but it didn't work maybe I'm not doing it properly?
  5. [1.1.6] Extract tiles properties from Tiled?

    you are confusing Gid with properties. I guess what he wants to do is to import the custom property lets say 50 and when he collect THAT coin he gets 50 POINTS (cash/w/e) if anyone find out how to get that custom property let me know cause I want to destroy my rocks every 3 hits and I can't find a way to use the Hitpoints value I set up... Edit: I found out how to do it for this example it would be rocks: and I want the custom property Hitpoints so all you have to do is: rocks.Hitpoints (And it should work) here I have that when an arrow hit one of the rocks from the group destroy the rock :3 hope this help
  6. how do you get the object layer properties from the individuals (cause I didn't saw it there though you might skip it by accident or something)
  7. Camera problem - following player

    I don't know what you mean with clip the visible area. I already have my game world set to 1216x800 but I do after that game.renderer.resize( 1216/2, 800/2); to make it look like the picture above (very close instead of super far), this is how it looks without the resize AND setting the bounds to 1216x800 as you said now this is how it looks with bounds in 608x400 WITHOUT setting up all the info I had (just like the one above) but if I add all the info back... I can actually move my character without loosing him only problem is the black screen to the left which is what I'm trying to fix, that stills comes up if I don't resize my game:
  8. Getting tile's properties.

    I know this is old but I made 6 objects all Type Objects with the property Health and I want to destroy those objects when their health reach 0 how I do I access the property and modify the value ?
  9. Global key event in all states

    I believe you can Preload the variable in lets say state 0 and then use it on any other state.
  10. Hello again, So I was making some buttons for my game and I have encounter a new enemy, since I resize my game to make it look like a zoom in style game I have found out that when I resize the game I kind of 'Loose' the properties of my buttons and they do not work anymore is there a way that the resizing doesn't affect my buttons ? thanks :3
  11. Camera problem - following player

    Manage to Fix part of the camera had to be more "specific" with my parameters and I notice that the (I believe is the dead zone) starts like this: is there a way to place it in the center? (I'll be checking camera documentation meanwhile if someone could help it would be amazing) and last but not less important, how to we add bounds to the camera? I add some but obvs not working (or maybe I'm doing it wrong but here : would like to show only the red part and not all the way to the blue part
  12. Camera problem - following player

    Hello I'm having an interesting problem with my camera, this is how my game looks without the camera following the player this is how it looks following the player... (the only good thing is that it actually follows the player) but I would like to know how to set up the bounds of the camera and to make sure it doesn't ... well do this. here's my code : scenes.scene3 = function(){}; //Player speed var link, vel = 150; //Map/Level var map; //Tiled Layers var floor, water,walls; //Object Tiled Layers var rocks var bushes1, bushes2, bushes3, bushes4; scenes.scene3.prototype = { preload: function (){ game.load.image('tiles', 'Assets/Sprites/Levels/zelda_01.png'); music = game.add.audio('openWorld'); music.addMarker('openWorld', 0, 16, true); game.renderer.resize( 1216/2, 800/2); }, create: function (){ //Game itself game.world.setBounds(0,0, 1216, 800); game.physics.startSystem(Phaser.Physics.ARCADE); map = game.add.tilemap('level_01'); map.addTilesetImage('tiles'); floor = map.createLayer('ground'); walls = map.createLayer('walls'); water = map.createLayer('water'); map.setCollisionBetween(0, 100, true, 'walls'); map.setCollisionBetween(0, 100, true, 'water'); //Objects layer related rocks = game.add.physicsGroup(); map.createFromObjects('rocks','ROCK','tiles', 48, true, false, rocks); rocks.forEach(function(rocks){rocks.body.immovable = true;}); bushes = game.add.physicsGroup(); map.createFromObjects('bushes', 'BUSHTOP', 'tiles', 37, true, false , bushes); map.createFromObjects('bushes', 'BUSHBOT', 'tiles', 35, true, false , bushes); map.createFromObjects('bushes', 'BUSHLEFT', 'tiles', 36, true, false , bushes); map.createFromObjects('bushes', 'BUSHRIGHT', 'tiles', 34, true, false , bushes); bushes.forEach(function(bushes){bushes.body.immovable = true;}); // music.play('openWorld', 0,1,true); // Player link = game.add.sprite((centerX-500), 100, 'LinkMovement'); link.scale.setTo(0.25, 0.25); link.animations.add('walkHorizontalRight', [6,7,8]); link.animations.add('walkHorizontalLeft', [9,10,11]); link.animations.add('walkVerticalDown', [0,1,2]); link.animations.add('walkVerticalUp', [3,4,5]); game.physics.enable(link); link.body.collideWorldBounds=true; //Life bar life = game.add.sprite((centerX-600), (centerY-675), 'lifeBar'); life.scale.setTo(0.15, 0.15); life.animations.add('fullHP', [0]); life.animations.add('twoHP', [1]); life.animations.add('oneHP', [2]); life.animations.add('Dead', [3]); cursors = game.input.keyboard.createCursorKeys(); var b1 = game.add.button(900,300, 'buttonFire', function() {fire();}); b1.scale.setTo(0.25,0.25); game.camera.bounds = (608,400); game.camera.follow(link); }, update: function (){ game.physics.arcade.collide(link, walls); game.physics.arcade.collide(link, water); game.physics.arcade.collide(link, rocks); game.physics.arcade.collide(link, bushes); if(cursors.up.isDown){ link.body.velocity.y = -vel; link.animations.play('walkVerticalUp', 9, true); } else if(cursors.down.isDown){ link.body.velocity.y = vel; link.animations.play('walkVerticalDown', 9, true); } else{ link.body.velocity.y = 0; link.animations.stop('walkVerticalUp'); link.animations.stop('walkVerticalDown'); } if(cursors.left.isDown){ link.body.velocity.x = -vel; link.animations.play('walkHorizontalLeft', 9, true); } else if(cursors.right.isDown){ link.body.velocity.x = vel; link.animations.play('walkHorizontalRight', 9, true); } else{ link.body.velocity.x = 0; link.animations.stop('walkHorizontalRight'); link.animations.stop('walkHorizontalLeft'); } }, fire: function(){ console.log('firing') var bullet = bullets.getFirstDead(); bullet.reset(link.x, link.y); }, drawHealthBar: function(){ if (hitPoints === 3) { life.animation.play('fullHP'); } else if (hitPoints === 2) { life.animation.play('twoHP'); } else if (hitPoints === 1) { life.animation.play('oneHP'); } else if (hitPoints === 0) { life.animation.play('Dead'); } } };
  13. Hello, I’m using brackets + Phaser to create a web game and I have ran into an issue, after setting up my tile map (which works perfectly fine) I decide to create buttons (attack, movement, etc) and at first I though I was doing a mistake or something but then I realise the button was “Invisible” and it was doing his purpose(that would be sending a message to the console) which means it was working (it was behind the Tiled layers) is there a way to fix this?