Adding health to an actor. Pick up items/health ammo etc.
Spaceface
Member Posts: 15
Can anyone tell me how to create a health attribute for my actor?
I'd like to have a healthbar at the top that takes decreases each time an enemy attacks and increase when picking up health items eg. food.
Also how can I create items for my actor to pick up. for example. coins, food for health, poison.
Sorry for the loaded question.
I'd like to have a healthbar at the top that takes decreases each time an enemy attacks and increase when picking up health items eg. food.
Also how can I create items for my actor to pick up. for example. coins, food for health, poison.
Sorry for the loaded question.
Comments
http://gamesalad.com/wiki/how_tos:gsc_health_bar?s[]=health
as far as creating collectables that's easy. you just need to create an actor & attribute for each type, coin, food, poison. then in each actor create a rule:
Coins
when actor overlaps or collides with actor of type Player
change attribute game.Coins to game.Coins+1
destroy actor
Food:
when actor overlaps or collides with actor of type Player
change attribute game.Health to game.Health+1
destroy actor
Poison:
when actor overlaps or collides with actor of type Player
change attribute game.Health to game.Health-1
destroy actor
Make sure you use the expression editor to select the attributes or it won't work.
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
http://gamesalad.com/wiki/how_tos:gsc_create_a_collectible_object