Digital,
Think about what you want to do, step by step, in 'pseudo code'. Slowly turn that into working blitz code. If you are stuck, try to break the problem into smaller pieces. A game (or any program) is really tons of small steps that move information around. There is no such thing as a weapon (no spoon Neo), unless you define one. Create all of its properties, and manipulate those to make them behave how you want as the game is processed...
Example:
-You want to check if the player is close to the weapon. Ask yourself how would you do this in code? Ask, what is available in Blitz to let me do this. Do I need to do the math myself, or is there a built in 'distance' function...?
Take the thought above and refine it a bit closer to real code:
If functionCheckDistanceBetween2Points ( (point1 = Player\LocationXYZ), (point2 = Weapon\LocationXYZ) ) returns a value that is less than theWeapon\maxPickupDistance then
do something!
Continuing to work through the problem:
-Check to see if they are looking at the weapon. (Do you want it in view, in the center, in an area? all these need to be answered)
-If the weapon is close, and the player has it targeted, then check to see if they have pressed the correct key or mouse button. (useKey, pickupWeapon, fire, you will have to create and map keys to your game commands/inputs.)
-Finally, remove the weapon from the scene, or hide it, and then add a new view weapon of the same kind to the player's inventory.
My 2c,
Think about what you want to do, step by step, in 'pseudo code'. Slowly turn that into working blitz code. If you are stuck, try to break the problem into smaller pieces. A game (or any program) is really tons of small steps that move information around. There is no such thing as a weapon (no spoon Neo), unless you define one. Create all of its properties, and manipulate those to make them behave how you want as the game is processed...
Example:
-You want to check if the player is close to the weapon. Ask yourself how would you do this in code? Ask, what is available in Blitz to let me do this. Do I need to do the math myself, or is there a built in 'distance' function...?
Take the thought above and refine it a bit closer to real code:
If functionCheckDistanceBetween2Points ( (point1 = Player\LocationXYZ), (point2 = Weapon\LocationXYZ) ) returns a value that is less than theWeapon\maxPickupDistance then
do something!
Continuing to work through the problem:
-Check to see if they are looking at the weapon. (Do you want it in view, in the center, in an area? all these need to be answered)
-If the weapon is close, and the player has it targeted, then check to see if they have pressed the correct key or mouse button. (useKey, pickupWeapon, fire, you will have to create and map keys to your game commands/inputs.)
-Finally, remove the weapon from the scene, or hide it, and then add a new view weapon of the same kind to the player's inventory.
My 2c,