help needed !!!

Talk about making games.

help needed !!!

Postby mr-game » Wed Jan 31, 2007 7:39 pm

im making a space shooting game and one of the pick ups is a shield but i want ti to be destoryed after 3 hits of the enemy i know how to make it kill the enemy on contact but how do i make it get destoryed after 3 hits
ty for help

i would like the 3 hits and destory the shield or...
make the shield last for 5 seconds the get destroyed or....
anyone whos good at hp bars tell me how to give the shield a hp bar that dies after 3 hits and i will just hide the hp bar

the pic is of my game with the shield ( blue ring ) up
Attachments
shield trouble.JPG
erm hi
mr-game
 
Posts: 28
Joined: Mon Jan 29, 2007 10:32 pm
Location: my computer
Score: 1 Give a positive score

Re: help needed !!!

Postby makslane » Wed Jan 31, 2007 8:27 pm

mr-game wrote:i would like the 3 hits and destory the shield


Create a variable hits (actor, integer)
On collision event of shield actor, put:

Code: Select all
hits++;
if(hits >= 3)
{
   DestroyActor("Event Actor");
}


make the shield last for 5 seconds the get destroyed


What?
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby makslane » Wed Jan 31, 2007 8:28 pm

BTW, use a more descriptive subject!
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby mr-game » Wed Jan 31, 2007 9:35 pm

like when i get the shield put up it only lasts for 5 seconds then goes
erm hi
mr-game
 
Posts: 28
Joined: Mon Jan 29, 2007 10:32 pm
Location: my computer
Score: 1 Give a positive score

Postby makslane » Thu Feb 01, 2007 12:58 am

1) On Create Actor event of the shield, create a 5s timer
2) On Timer event of the shield, put:

Code: Select all
DestroyActor("Event Actor");
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest