parkm / oldbpm

A JavaScript game where you shoot at bubbles.
0 stars 1 forks source link

Weapons and Elements #35

Open parkm opened 10 years ago

parkm commented 10 years ago

Different weapons which shoot different types of bullets. https://github.com/despondentdonkey/bpm/commit/d96595fe3d3d9f44719e98f605a209621b7ca3d7

parkm commented 10 years ago

Are instances of weapons being cached in bpm? I think there should only be a string of the current weapon. Then when switching to Field we recreate the weapons, since they don't need to remember anything. Upgrade values will just be reassigned.

dgpt commented 10 years ago

Nope, they're saved in Field.savedWeapons. There only is a string in bpm. I put all of the key maps in bpm, though. I think it should be used as the center of configuration for the game.

dgpt commented 10 years ago

Actually, bpm.player.currentWeapon can either be a string or an instance of Weapon. I'll fix that; that is confusing.

parkm commented 10 years ago

What about weapon switching outside of Field? We should be able to change the weapon anywhere, will that work when it is a string? Also switching to the same weapon resets the ammo.

dgpt commented 10 years ago

Yeah, that works. Just set bpm.player.currentWeapon. I just fixed the switching to the same weapon bug on 8157810a0e45d31ce56b96760704c80ded8e7c48 it was only an issue when using the debug buttons because they pass a string. It's all good now tho.