Search the Community
Showing results for tags 'upgrades'.
-
Hi everyone, Looking for some advice on the approach to coding multiple powerups/upgrades. I have googled how to do this but most answers are in c#/java or based on unity so I have trouble understanding what there doing. I am making a geometry wars/asteroids clone and I am giving the player upgrades when they defeat a boss or reach certain multipliers/kills. The problem is that I am having to change lots of code and using lots of if statements to see if a powerup has been activated then changing the bullet effect and then having to change the collision function for the bullets hitting the enemies so that each powerup does something different. For example in my powerup file (handles bullet changes when new power is activated and powerup pick ups) I add more if statements to the bullet logic to change for example the bullet speed and texture then I go into the file that handles collisions and make changes to the bullet / enemies function so that if the bullet is a fire bullet for example, the enemies particle effect is changed to red from blue. I know there are better ways to do this but I'm not sure how in javascript (or any language) any help would be really appreciated some code: powerups.js (bullet logic handler function for special bullets) const scene = this.scene; const utils = this.utils; const player = scene.player.sprite; if (bullet && utils.playerDied === false) { if(utils.explodingBullet) { if(utils.specialLevel > 1) { utils.bulletSpeedSpecial = 120; } else { utils.bulletSpeedSpecial = 250; } bullet.setTexture('explodeBullet'); } else if(utils.flameBullet) { utils.bulletSpeedSpecial = 75; bullet.setTexture('orange'); if(utils.specialLevelCheck === false) { utils.specialLevelCheck = true; scene.flameEmitter.explode(); } if(utils.specialLevel > 1) { player.setTexture('playerO'); scene.playerTrailEmitter.setFrame(['white', 'orange']); } } else { bullet.setTexture('bullet'); player.setTexture('player'); scene.playerTrailEmitter.setFrame(['white']); } bullet.fire(player, scene.reticle); utils.lastFiredSpecial = time + utils.bulletSpeedSpecial; scene.physics.add.overlap(scene.baddieGroup, bullet, scene.callBacks.shootingBaddies, null, scene);
-
Hello everyone, It's my first game done with Javascript, I've been working on it almost 3 months in my spare time. Game saves the progress with cookies. Looking forward to hear your opinions and feedback. Here is projects GitHub - https://github.com/JasperCherry/HotSteel Here is the game on my uni server - http://doc.gold.ac.uk/~kwisn001/games/HotSteel/ Some screenshots:
- 3 replies
-
- browsergame
- desktop
-
(and 2 more)
Tagged with:
-
Hi everyone, Game - http://liquidrainbow.net/html5/submarine/deploy/ I would like to show latest release from our team - Submarine Dash. This game is like Jetpack Joyride but underwater. You need to collect coins to upgrade your crappy sub to world class submarine P.S. In case if some publishers looking for content here. We are looking for non-exclusive licenses. If you are interested - [email protected] or contact us here