Every 1 sec.

Non-platform specific questions.

Every 1 sec.

Postby BabaRoga » Tue Apr 06, 2010 3:05 pm

How can I make an actor to shoot every one second from begening of game ?
BabaRoga
 
Posts: 19
Joined: Thu Nov 30, 2006 7:14 pm
Location: Presheva , Serbia
Score: 1 Give a positive score

Re: Every 1 sec.

Postby Thanx » Tue Apr 06, 2010 3:27 pm

1. Create an actor, name it shooter, let's say...
2. Among events, select Create Actor
3. Select Create Timer as an action
4. For Actor: select shooter
As for a Timer: select New Timer
5. Name it for instance 1sec
6. 1 second is 1000ms, so enter 1000 under the name.
7. Leave everything the way it is, and say press Ok (The rest deal with creating random intervals in selected boundaries, and with timers that don't go on forever, but for a set number of time. Count: * means the timer never stops.
8. You arrive back at the Create Timer window. 1sec is selected as timer. So now click Add, and choose Immediate Action.
9. Now create another actor called shot. In its Actor Control: Change create at startup to NO.
10. Return to the actor control of the shooter, and Select another event, this time it's the Timer event. Click it, and then select 1sec as the timer to react upon. Then click Add Action, and choose Create Actor.
11. Select actor shot, Leave Parent and Path alone, and everything else for now. You're almost done.
12. Now return to the shot actor, where you create an event, a Create Actor event, on which you add action: Script Editor.
13. The script editor appears, and you write:

shot.xvelocity = 5;

Modify the number to make the shot the speed you want. If you want it to move vertically, then modify yvelocity. Then click add, and then you say Close for the add action window there.
You're now done, click Game Mode, and it's supposed to work. If you want to modify where the shot gets created, then Edit the Timer event, Create Actor action of the shooter, and change the x, and y positions... That you can play around with until you're satisfied.

Hope that wasn't too long, too noobish, or anything... :wink:
http://www.youtube.com/watch?v=XyXexDJBv58
http://www.youtube.com/watch?v=Be4__gww1xQ
These are me and playing the piano (second one with a friend/fellow student)
Hope you watch and enjoy!
User avatar
Thanx
 
Posts: 314
Joined: Sat Jan 26, 2008 10:07 pm
Location: Home sweet home! :)
Score: 24 Give a positive score

Re: Every 1 sec.

Postby BabaRoga » Tue Apr 06, 2010 3:44 pm

Thanks Thanx, +1 score
BabaRoga
 
Posts: 19
Joined: Thu Nov 30, 2006 7:14 pm
Location: Presheva , Serbia
Score: 1 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron