Now:
October Challenge 2014
Ends in:

Coming Soon:
Ludum Dare 31
December 5th-8th, 2014

PST: 6 PM
*EST: 9 PM
UTC: 02:00

ConstructionPlease excuse the site weirdness. Mike is making and fixing things. Clocks are probably wrong. Colors are place-holder.

Ludum Dare 31:
Ludum Deals
???
 
Recent:
MiniLD #XX

Posts Tagged ‘health’

Some scripts I made to make things easier

Posted by (twitter: @Zazanxors)
Friday, August 22nd, 2014 8:26 pm

Straight to the point, these are some scripts I wrote in C# for Unity 2D stuff that I’ll be using – feel free to use them any way you want.

TileTextureManager.cs

This script is ment to make creating platformer scenes a bit easier. Assign it to the tile you are using and then give it six sprites for said tile – it will detect nearby tiles and automatically select the appropriate sprite to use, then rotate as needed so that you can place tiles and leave it to the rest.

PlayerMovement.cs

Pretty self-explanatory, this is a simple script to act as a sort of 2D CharacterController for the player. Comes with a debugging option. Requires a trigger collider to detect whether or not the player is on the ground.

EnemyAI.cs

Also rather self-explanatory. Simple script that doubles as very basic A.I. and physics handler for enemies. Physics is nigh-identical to player physics. Also includes debugging option and also needs a trigger collider.

HealthLogic.cs

Decent health script I wrote for whatever needs it. EnemyLogic will need this to deal damage properly to the player properly. Includes logic for invulnerability periods after getting hit. Debugging on this will only display health in the console.


[cache: storing page]