Im trying to create a game similar to crimsonland where you have hordes of enemy coming at you and you try your best to keep them at bay until the inevitable defeat. The player has only one weapon to use at any given time, but can change the weapon if anotherone is spawned to the playfield.
What i would want to create, is the player to have a max of two weapons at his/her disposal. a primary, and a secondary weapon. That he could change should an enemy drop one for example.
Where i've gotten so far, is that i have the player start off with nothing. he can pick up two weapons that shoot their own bullets and the weapons can be changed through mousescroll. Now on the mousescroll change, i have a bit of an issue that i cannot seem to figure out. The weapons on the ground react to the mousescroll before i've even picked the up. How would i set it so they only react to the mousescroll if equipped by the player? Another issue is the bullets. I've got a shotgun on the game that shoots a burst of pellets. Problem is, all of the pellets dissapear after only one hits an enemy or goes over the grid. I assume this would be related to the fact that the bullet has a container that has the rest of the pellets attached to it.
- Code: Select all
The gamefiles can be found at https://www.dropbox.com/sh/j9xxg9strbnfw5z/AADeIzHrZkAt_mDV036b7Klaa?dl=0 to see what i mean. Or https://dl.dropboxusercontent.com/u/73502848/New%20project/index.html to test the game on a browser.
^-- i guess im not allowed to post url:s , but im assuming im not hurting anyone here by going around the blocking like this..