>>>Now we are going to create a Dialogue Actor
that would appear on screen when "s" is pressed.
This function wil enable us to "choose" out of the
two guns picked.
add Actor "Dialogue"
add Animation "dialogue.png"
>>>This is a transparent image that will appear
when u press "s" button. It is within this dialogue that
u would be able to actually choose ur arm
(red or blue).
>Add Event ("Draw Actor") on "dialogue"
add Action ("Script Editor") and write :
- Code: Select all
if(currentarm>1) VisibilityState("Event Actor", true);
else VisibilityState("Event Actor", false);
>Add as immediate action.
>>>Now anytime u press on "s", the dialogue
appears,and it disappears after 3 key press.
What i want the player to do is that whenever he
picks an arm, he must actually "select" it by pressing
"s" and then he can use it by pressing "c".
To make things simple, we will create little icons
that would show us whenever an arm has been
picked.
add Actor "red_icon"
add animation "red icon.png"
add Actor "blue_icon"
add animation "blue icon.png"
Select "red_icon" :
>Add Event ("Draw Actor") and add Action ("Script Editor")
and write :
i
- Code: Select all
f(currentarm==2 && red==1)
{
VisibilityState("EventActor",true);
}
else
{
VisibilityState("EventActor",false);
}
>Add as immediate action.
Select "blue_icon" :
>Add Event("Draw Actor") and add Action ("Script Editor")
and write :
- Code: Select all
if(currentarm==3 && blue==1)
{
VisibilityState("Event Actor", true);
}
else
{
VisibilityState("EvenetActor",false);
}
Add as immediate Action.
>>> Now u can test the game. Pick an arm(red or
blue) and press "s". The result is that if u have
selected the red gun, the "red_icon" appears and if
u have selected the blue gun, the "blue_icon"
appears.