Friday 23 June 2017

Unit 71
 OO Design within the game 

my character

shooting

The shooting blueprint works by using a "if" statement checking weather the variable for the guns mag is greater than 0 it will -1 from the magazine count and +1 on to used ammo variable if true then it will fire, if false it will display reload on the screen. The movement for the character works by pressing W,A,S,D to move around but is blueprinted using a movement input blueprint. but the rifle has a extra branch which checks if the gun is auto or not if it is false then it will shoot normally if true it will go though a gate thats linked to the tick event to make is automatic.




reload

This works by checking if the ammo count in the magazine is equal to 8 if true it will display clip full, if false it will then see if the overall ammo count is greater than 0; if true it will then check if used ammo is greater than the overall ammo count. When false it will take away used ammo from the overall ammo count and refill the magazine to full and reset the used ammo to 0. 

select fire

this works by pressing q to change the Boolean variable using a flip flop to switch between tru and false.

laser or touch 

this works by pressing f to switch between the flash light and the laser on both weapons for this to work i used the set light intensity to 0 to turn off and then max to turn on.

throw spear 

this works by pressing k to create the spear projectile its just simple spawn actor at the location of the player.

sprint

this works by pressing left shift pressed will add 600 to max speed when released is will set it back to normal.

switch gun 

this works by pressing 1 to show the pistol and the ammo integers for this gun 2 will show the rifle and this guns integers.

rifle aim though scope 

first it checks if the weapon is the rife then is starts a timeline which the return value will set the zoom distance then it just sets visibilty to visable then and then sets the gun hidden when button is relesed it dose the reverse of the pressed.

widgets
ui 

the ui is pritty simple all it dose is draws the variables to the health bar, energy, mood and then characters ammo.  main menu this just has buttons. play opens world level and quit closes game. scope this is the widget for the rifle aim.

enemy

movement
this uses ai move to. its desternation is just random untill it sees the player then it will follow the player untill it collides then it will move random again.

hit
this event just makes a collide action for all projectiles simple when projectile hit destroy actor but the spear will stick to the enemy inbeded in the characters chest.

car
when you press e it will allow you to get in and out of the car tab enables the interior camra. the car can only go certain places

No comments:

Post a Comment