Wednesday, January 30, 2013

Mark's update 1/30

This week Travis and I worked on technical documentation for the scripts in the game. Our game is basically composed of a few objects: The player, the zombies, the tootsie bombs, the zombie spawner, doors, checkpoints, and triggers. In its most basic form, it will need all of these things.

Scripts:

Main character:    Uses Unity’s default Player script.

Melee system:
Piñata stick is shown in the right hand corner. A small piece of hand is shown at the bottom.

attack timer = setTime. decreases to zero. setTime for left click is x. setTime for right click is 2x.

if Left click  && attack timer is 0, then swing animation plays

if distance from zombie < setDistance && if rotation is facing zombie, zombie health - damage;

if right click && attack timer is 0, harder swing animation plays

if distance from zombie < setDistance && if rotation is facing zombie, zombie health - increasedDamage;

Jumping: Unity’s built in jump script. Height tbd

Movement: Unity’s built in character script. Speed tbd

Health: GUI bar at top of screen shows % of max health. width of the bar = maxWidth * % health

Healing: if q key is pressed && numCandies >= candyBarConversion, then:
numCandies -= candyBarConversion
health += setHealthAmount
health bar is updated.

Tootsie bomb:
if R key is pressed and held, crosshair appears on screen, player can still aim (see character script)

if R is released, play friend pinata animation,
new instance of tootsie bomb is created with orientation of player’s camera, with initial forward force of x. countdown timer begins.

if countdown timer == 0, then explosion animation plays,
if zombie is in blast radius, y, then zombie health -= damageOfBomb * (1-%distanceOfMaxRadius);
create scorch plane at coords of bomb





Zombie Piñata:

zombie LookAt(player), apply forward force of speedVar;
speedVar can be initialized randomly (within set boundaries)
if distance < setDistance && attackTimer <= 0, then attack animation plays, player health -= zombieAttack

set a health var
if attacked, apply force back away from character, health -= attack

if health <= 0, play  dying animation. create confetti object (animated clip). spawn random number of candies (1 to 5) at dead pinata position (+ or - random number so they don’t all spawn at the same spot). after animation, remove dead pinata.



Dialogue Object: When the player crosses this invisible object, the next dialogue recording begins to play.

Zombie Spawner Object: This object is the spawn point for the zombies. These will either run on a timer (especially for the wave sections) and a timer with a spawn limit for the rest of the areas.

if timer < 0 && max spawn num is not reached, spawn zombie.

Door Script
if player’s distance < doorDistanceVar && door is closed && key E is pressed, open door.



I've also been working on the player's attack script. I've decided that I need to use a raycast from the player's camera to whatever they're pointing at. If the raycast hits a zombie and the distance of the raycast is less than a certain distance, damage will be dealt to the zombie. This has been completed, and after the health gets down to zero, the zombie disappears.

I also played around with the zombie look script. Before, the zombies looked directly at you at every moment during the program. Now, there is some damping on the look, so it takes them a few moments to turn to face you.




No comments:

Post a Comment