AramCP

Members
  • Content count

    30
  • Joined

  • Last visited

About AramCP

  • Rank
    Advanced Member
  • Birthday 05/14/1999

Contact Methods

  • Website URL
    http://aramenlared.com/pokemonjs/
  • Twitter
    @CreandoPKMN
  • Skype
    aramllcreandopkmnll

Profile Information

  • Gender
    Male
  • Location
    Spain
  • Interests
    Sex, food and sleeping

Recent Profile Visitors

323 profile views
  1. Could you show me a little example about how to do it? I usually dont need all that help but im so confused.
  2. Maybe that will work for star the game, but for making the player movements, i think it wouldnt, because my player movements look like this right now: if(game.input.activePointer.leftButton.isDown && game.input.activePointer.position.x <= 128){ player.body.velocity.x = -velocityy; player.animations.play('left'); return; } if(game.input.activePointer.leftButton.isDown && game.input.activePointer.position.x >= 128){ player.body.velocity.x = velocityy; player.animations.play('right'); return; } else { player.animations.stop(); player.frame = 3; } As you can see i cant use game.input.onDown.add(this.movementFunction, this); Pff i dont know how im going to solve this, but thanks anyway.
  3. Hi guys, i implemented touch controls for my game, but they dont work on phones, only in computers with a mouse. Im using this: //In create function: game.input.mouse.capture = true; //And update: update: function(){ if(game.input.activePointer.leftButton.isDown){ game.state.start('game'); } }, The only thing that i wanted to do with that is start the game state when you click on the screen, and it works perfectly in my computer, but in my phone does nothing, and it should because in phaser docs it says this: A Pointer object is used by the Mouse, Touch and MSPoint managers and represents a single finger on the touch screen. So guys can anyone explain me whi this isnt working? thanks.
  4. Nice, didnt thought in that, thanks man!
  5. By touching i mean that the pointer is over the sprite body yes, like in this image: http://prnt.sc/dqoza Lets imagine that the red ball is the mouse poiner, so as you can see, he is above the sprite called play.
  6. Hi guys, im implementing touch controls to my game because i want to export it to android in the future, its the first time i do that and i want to know how can i make something that detects if the pointer is colliding with a sprite. I am using this for movements of the player and it works: if(game.input.activePointer.leftButton.isDown && game.input.activePointer.position.x <= 128){ player.body.velocity.x = -velocityy; player.animations.play('left'); return; } And the same for the right. So i want to make something like that, but instead of x position, i want to dettect if the pointer is touching a sprite, any ideas about how can i do that? thanks
  7. Thanks man it works now, btw i will check how works that browser storage.
  8. The second one is exactly what i want, but just for one session
  9. For the moment i only want to store it for one session, im not very experienced programmer and i dont really know how to implement that code you put above in my code :/, i would like to but i dont even understand what the code does, i mean i know what you want to do, but i've never used something like that before, and i preffer to dont use things that i dont know for what they're. But i apreciate the help, this will be usefull for me in the future.
  10. Hi guys i have a game where you collect money, and then a menu, where i want all your money to be shown. I have a var called money, and a var called totalmoney. And i want to store all the money that i gain playing in that variable. For example, i play the game and i collect 20 money. And then this money has to be shown on the menu screen, well thats easy, in the menu screen you create a text saying: game.add.text(128, 0, money+'$') and the money will be shown, but what if i want to play again? I cant do the same thing because the money gained will overwrite the actual money, so guys any idea about what can i do?
  11. I dont think so because dollar is inside a group, and that group is inside a function, and i call this function in the create function so all is ready to pass throught the update function. Btw i solved it, i executed it in another browser, and i've noticed that i have to put a this, before the DollarCheck(); So instead of DollarCheck(); i wrote this.DollarCheck(); And now it works. But thanks anyway mate.
  12. Hi guys, as i advanced in my game, i divided it into states, and when i enter to the game state, the browser returns me an error saying that my varibale (dollar) is not defined. The thing is all was working well before i separated it into states. Thats what i have: var dollars; var dollar; var gamestate = { DollarCheck: function() { randomx = Math.random()*208; randomy = Math.random()*170; dollar = dollars.create(randomx,-18,'dollar'); player.body.setSize(48, 28, 0, 0); game.physics.arcade.enable(dollars); }, create: function() { dollars = game.add.group(); DollarCheck(); }, update: function() { player.body.velocity.x = 0; dollar.body.velocity.y = velocityy; }, }; This is not all the code, just the dollar containing one, but i cant post the entire code if you want. As i said when i run it, the browser says me that dollar is undefined in line (the line where is dollar.body.velocity.y = velocityy; ). Do you see something wrong in the code guys?
  13. phaser

    ofc, here is the entire code: var game = new Phaser.Game(256, 392, Phaser.AUTO, 'game', { preload: preload, create: create, update: update }); var player; var cursors; var dollars; var randomx; var randomy; function preload() { game.load.image('background', 'assets/background.png'); game.load.spritesheet('minisprite', 'assets/spritesheet.png', 48, 72); game.load.image('dollar', 'assets/dollar.png'); game.load.image('scorebar', 'assets/score.png'); } function create() { game.physics.startSystem(Phaser.Physics.ARCADE); game.add.sprite(0, 0, 'background'); game.add.sprite(0, 352, 'scorebar'); randomx = Math.random()*256; randomy = Math.random()*300 player = game.add.sprite(100, 248, 'minisprite'); game.physics.arcade.enable(player); dollars = game.add.sprite(randomx, -18, 'dollar'); game.physics.arcade.enable(dollars); player.body.collideWorldBounds=true; cursors = game.input.keyboard.createCursorKeys(); player.frame = 3; player.animations.add('left', [0, 1, 2, 1], 6, true); player.animations.add('right', [6, 5, 4, 5], 6, true); } function update() { player.body.velocity.x = 0; dollars.body.velocity.y = 60; if (cursors.left.isDown){ player.body.velocity.x = -60; player.animations.play('left'); return; } if (cursors.right.isDown){ player.body.velocity.x = 60; player.animations.play('right'); return; } else { player.animations.stop(); player.frame = 3; } }
  14. Hi guys today i started making a game and i got a problem. I want to make a game where you move to the left and to the right and items are falling from the sky, the thing is i can make one item fall in a random position, thats easy: var randomx; randomx = Math.random()*256; dollars = game.add.sprite(randomx, -18, 'dollar'); Then i set a velocity and it starts to fall, the problem comes when i want to make fall more than one sprite. I thought about something like this: var randomy; randomy = Math.random()*300; And in update function: if(dollars.position.y = randomy){ game.add.sprite(randomx, -18, 'dollar'); } With that i wanted to make a dollar fall, and when that dollar reaches a random point in the Y cordinate, another dollar will start falling, but it doesnt work, could you help me please?
  15. I think you solved my problem saying that! Im going to try it right now xD thanks!