Jump to content

Search the Community

Showing results for tags 'counter'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 5 results

  1. bucket counter! (-_-) In this game there is a bucket that is the player and it needs to be filled with 10 drops to reach the goal, then the counter is reset and starts a new round..In the game you have to collect the drops in numerical order 1-10. *The game available also for smartphones *license MIT bucketGame.zip
  2. Basically I am making a cookie clicker type game for fun. I am trying to make the counter increase each time the sprite is clicked on but for some reason the click event on the sprite is never fired if i click on the sprite. I can't figure out why the click event isn't firing does anyone know why? Or a better way of doing this? <!doctype html> <html> <head> <meta charset="UTF-8" /> <title>Shook Clicker</title> <script src="https://cdn.jsdelivr.net/npm/[email protected]/build/phaser.js"></script> </head> <body> <script type="text/javascript"> var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update }); var clicker; var clicks = 0; var scoreText; function preload() { game.load.image('clicker', 'assets/cookie.png'); } function create() { clicker = game.add.sprite(game.world.centerX, game.world.centerY, 'clicker'); clicker.anchor.set(.5); clicker.scale.setTo(.1,.1); clicker.inputEnable = true; scoreText = game.add.text(16,16, 'Computers Built: 0', {fontSize:'32px', fill: '#555'}); clicker.events.onInputDown.add(listener, this); } function listener() { clicks++; scoreText.text = 'Computers Built: ' + clicks; } function update() { } </script> </body> </html>
  3. pheaset

    View Counter

    Hey Guys, I was wondering if anybody knew how to add a view counter. I want to know how many views my breakout game will get when it is launched and the same for my other tennis game. Help is really appreciated Pheaset
  4. I saw a few examples and games with implemented simple score logic. Seemed easy enough. But why is my counter updating like crazy? By each passed obstacle it jumps to 20 or so. Is it because the game loop calls each function 60 times per second. If so, what should I do? I want the counter to itterate by 1 each time an obstacle is passed(behind the player or out of bounds). The game is an endless runner type. My code: update{ obstacles.forEachAlive(this.passedObstacle, this); }, passedObstacle: function(){ var obstacle = obstacles.getFirstAlive(); if (obstacle.x < player.x) { obstacle.kill(); // with or without - same thing pass += 1; passText.text = 'pass: ' + pass; } }, // Tried with (obstacle.x < game.world.bounds.left) // AND // (obstacle.x + obstacle.width < game.world.bounds.left)
  5. Hi, I am trying to to use the code from an example for dragging sprites to let me count the number of times a sprite has been clicked. I want to place sprites on the screen that will serve as buttons that will tell the stage to addChild new Sprites. I have been able to place a button and cause that button being pressed to generate one new sprite, but now I want to generate more exactly like it. And I am not sure how to do this. Also, I am not sure if placing the logic to create a new sprite inside the mousedown function curly braces is the best way to be creating the first sprite to begin with. See my code snippet below for an example. addResistor.mousedown = addResistor.touchstart = function(data){ // stop the default event... data.originalEvent.preventDefault(); // store a reference to the data // The reason for this is because of multitouch // we want to track the movement of this particular touch this.data = data; this.alpha = 0.9; this.dragging = true; stage.addChild(resistor); }; addResistor is the sprite that serves as the button and resistor is the sprite that gets added. I had thought of using a counter variable declared outside the curly braces and passed in, but this doesn't seem to work. I am open to creating a slightly different resistor each time by addChilding one labeled R1 for the first push, and R2 for the second push if creating duplicate Sprites is not possible/ too difficult.
×
×
  • Create New...