0% found this document useful (0 votes)
68 views7 pages

Flowcharts

The document contains scripts for various components in a 3D game: A bullet script that moves bullets forward each frame and deals damage if colliding with an enemy tag. Enemy and player health scripts lower health when taking damage and destroy the object if health reaches 0. A shooting script fires bullets when the mouse is clicked after raycasting to detect enemies. Other scripts handle enemy movement, respawning, camera following the player, player movement controls, and a turret that locks onto and shoots at targets.

Uploaded by

api-428384269
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
68 views7 pages

Flowcharts

The document contains scripts for various components in a 3D game: A bullet script that moves bullets forward each frame and deals damage if colliding with an enemy tag. Enemy and player health scripts lower health when taking damage and destroy the object if health reaches 0. A shooting script fires bullets when the mouse is clicked after raycasting to detect enemies. Other scripts handle enemy movement, respawning, camera following the player, player movement controls, and a turret that locks onto and shoots at targets.

Uploaded by

api-428384269
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Bullet script

START Each frame move the


object forwards

When trigger volume


collides with another

If collided object
has tag of
“Team1”

Set target to be
the collided
gameobject

Get the health


component of the target
and deal the value of
damage to it

Destroy the bullet End of script


gameobject
EnemyHealth script

Start
If take damage is
called health is
lowered by preset
amount If health isn’t below
0

If current health
is 0 or less than
enemy dies

When enemy dies destroy


the object

End

PlayerHealth

Check every frame


Start If below 0 then die
whether health
has been lowered
to 0 or below

When die destroy the


player and print a
message to for
debugging
Shooting

start If player presses


left mouse
button

Else if not currently


clicking turn off laser

Turn on laser
effect and shoot

When shooting send out raycast


checking whether object is in
range and is an enemy

If not in range or
enemy nothing
happens If it is in range and
enemy then deal damage
to the enemy

end
Enemy movement

Every frame run


start movement, turning
and pathfinding
method

Move forward at a Turn to face the target


set speed over time

Shoot out rays in


multiple directions
to check for
obstacles

No obstacle found

If obstacle is
found in the
way

Move out of obstacles


way
Enemy respawn

start

Repeat spawning every


set time period

Spawn the enemy in each


time

Followcam

Find the position of


start
player

Every frame smoothly move


the camera to a specific
distance behind the player
Playermovement

start Every frame run the turn


thrust and acceleration
methods acceleration

Turn method If shift is pressed


changes
acceleration level

If button is If button is If button is


pressed changes pressed pressed
yaw changes pitch changes roll
thrust

Continuously move
forward at the
speed determined
by acceleration
Turret

start If not found


target
Check for target
entering a trigger
area

Target is locked
and turret turns
towards target

If target
goes out of
When the shot is range
ready turret then
shoots

After each
shot
Spawns a bullet object
in the world which will
move forward and
then waits a moment
until next shot is ready
and repeats unless
target has gone out of
range

You might also like