Search the Community
Showing results for tags 'value'.
-
hi all, im wondering how can i tween a numeric value lets say. var number1; /// in create function number1 = 100; ///tween from 100 to 10 and show it by a text text1.setText( " from 100 to 10: " + number1+ " "); its possible? im chasing a way to show player his score after complete world. but i wanna show him the time bonus and move the time left to zero on screen. any suggestion?
-
So I have been working on this tycoon game for a few days now, (you can try what I have so far here) http://www.newgrounds.com/projects/games/935963/preview As a next feature I was going to add a money system, where each tile would cost $15 to place down Here is the code I'm using to place a tile down if (game.input.mousePointer.isDown) {if(!outarange){ if (sandbox.getTile(layer.getTileX(marker.x), layer.getTileY(marker.y)) != currentTile) { mtween.x = this.input.activePointer.worldX; mtween.y = this.input.activePointer.worldY-50; mtween.visible = true; money -=15; sandbox.putTile(currentTile, layer.getTileX(marker.x), layer.getTileY(marker.y)); } }}If you tried the demo, you might have realised that the money value goes down every frame while you're holding down the click button. How would I do it so it only gets decreased by 15 everytime a new tile is placed. Thanks for the interest