I've been trying to figure out for some time now how to switch "weapons" but i can't figure out how to switch a class when a key is pressed. Any help? Or methods that would be of use?
I think you have two options.
1: You have different images and switch them, if the key is pressed.
2: You don't switch the images, but you have different classes for your weapons. So your weapon is an object which you have to remove and set an other one when the weapon is switched.
I'm not planning on switching the image of the gun just the bullet, but i would like to switch the bullet class so i can program the other bullet to do other things, right now i just have a machine gun, but when "1" is pressed it will switch to a faster machine gun.
One thing many new programmers do not seem to grasp is this: the different characteristics and behaviours of a certain type object does not neccessarily require a new class of object. Variables can be used to determine the image to use or the speed of the object it creates, The class can be given methods to access the value of those variables so that other classes can determine the appropriate actions to perform when dealing with those objects. Please review the first section in the Java Tutorials for an example of using these fields (or variables).