Weapon system 4 platformer
Author: | HOSJ
|
Submitted: | 18th November, 2002
|
Views: | 5363
| Rated: |
|
|
Yay my first article! I hope it helps someone out there with shooting game needs.
I think this may be pretty basic, but effective as well.
OK- to use for a keyboard aiming system that rotates a weapon up to 90 degrees each direction: left or right.
Now....
STEP 1: create a character however you want with all his animations, but dont arm him at all, dont give him arms (no pun intended) either. you will see why in a minute.
STEP 2: Create an active object named 'weapons'.
STEP 3: in the animation screen, notice there are larger dots around the circle. make a weapon animation with your character's arm and gun/whatever in the one farthest to the right and put the hotspot on the shoulder. Rotate.
STEP 4: You will notice that the left animations are upside down. To fix this....
Copy every right side animation to the left side and flip them horizontally.
STEP 5: Create a new animation on 'weapons' for each gun/whatever by repeating steps 3 and 4.
STEP 6: The engine....
ALWAYS--------- set weapons to 0,0 from character,
Set weapons direction to ValueA- Weapons
*PLAYER 1 MOVES LEFT------ set valueA 'weapons' to 16 (faces left)
*PLAYER 1 MOVES RIGHT------ set valueA 'weapons' to 32
(faces right)
*-character must be controlled by player 1.
CHARACTER IS FACING LEFT
+PLAYER 1 MOVES UP------------- sub 1 to valueA 'weapons'
CHARACTER IS FACING RIGHT
+PLAYER 1 MOVES UP------------- add 1 to valueA 'weapons'
CHARACTER IS FACING LEFT
+PLAYER 1 MOVES DOWN------------- add 1 to valueA 'weapons'
CHARACTER IS FACING RIGHT
+PLAYER 1 MOVES DOWN------------- sub 1 to valueA 'weapons'
(these rotate it up and down)
-Assign a select key which alters the valueB of 'weapons', and changes the animations/guns-
-Also make it shoot something different for each animation when you press the FIRE key -
VALUE A 'weapons'= 37----- Sub 1 to valueA 'weapons'
VALUE A 'weapons'= 11----- Sub 1 to valueA 'weapons'
VALUE A 'weapons'= 27----- Sub 1 to valueA 'weapons'
VALUE A 'weapons'= 21----- Sub 1 to valueA 'weapons'
(these put limits on how far it can rotate either way and can be changed to make the limits larger or smaller, these make it so it can only go 45 degrees up and 45 degrees down in either direction)
Now- to fix the bug of the gun facing the opposite direction as the character walks/runs/whatever....
CHARACTER IS FACING LEFT
+'weapons' IS FACING RIGHT--------- set valueA 'weapons' to 16
CHARACTER IS FACING RIGHT
+'weapons' IS FACING LEFT------- set valueA 'weapons' to 32.
Well please comment on my first article and tell me if you could use it anywhere and it's worth reading/using.
|
|
HOSJ
Registered 01/07/2002
Points 669
|