Page 1 of 1
Need help on powerup
Posted:
Sun Aug 19, 2007 12:26 am
by 98700
Im making a game were there are powerups. The problem is im making a double shot powerup but dont know how. Before: . After: . . ! It starts as one shot in the middle of ship but after power up one on each side. PLZ help!
Posted:
Sun Aug 19, 2007 9:20 am
by Caaz Games
ok i haven't used game editor in a while so ill try to think up something.
actor "Ship"> Collision event actor "Powerup"
- Code: Select all
PUp = 1; //add a variable named PUp
actor "Ship" > Keybutton down event "Whatever"
- Code: Select all
if(PUp == 0)
{
CreateActor("Shot", "NoPowerUp", 0, 0);
}
else
{
CreateActor("Shot", "PowerUp", 0, 0);
}
that code wont work because the "CreateActor" thing isn't right you have to replace it with the code in GE.
I hope that works!
P.S. I'm back!
Posted:
Sun Aug 19, 2007 12:04 pm
by Bee-Ant
make a "power" variable, global or actor whatever...
in the "create actor" of your actor put this code :
power=0;
in "collision event" with PowerUpper actor(for example "gold") put this code :
power++;
then in your keydown event of your actor, put this code :
if(power==0)
{
Create Actor("Shot", "ShotImage", ("none"), ("none"), 0, 0);
}
if(power==1)
{
Create Actor("Shot", "ShotImage", ("none"), ("none"), 0, 0);
Create Actor("Shot", "ShotImage", ("none"), ("none"), 0, 5);
}
The second "if" code will create double shot...
I hope that code will help you...
note : don't copy-paste that code
Posted:
Sun Aug 19, 2007 1:17 pm
by 98700
thank you guys.
How come i cant copy n paste
Posted:
Sun Aug 19, 2007 1:26 pm
by Caaz Games
this is the actual code for create actor
CreateActor("Actor", "Animation", "(none)", "(none)", 0, 0, false);
the ones we used dont have all the stuff
Posted:
Sun Aug 19, 2007 3:48 pm
by 98700
wait how do i make a power variable? wat do i write in global code for variable? im a begginer
Posted:
Sun Aug 19, 2007 8:54 pm
by Bee-Ant
Go to script editor from any actor...
then clik "User Vars" at the bottom side...
click "Add" then make that variable...
Global variable be in effect for every actor, Actor variable just for that actor...
If you will make "power" variable, make it as "string"
If you still confused, I'll make a demo for you...
Posted:
Sun Aug 19, 2007 9:06 pm
by 98700
make demo plz
Posted:
Wed Aug 22, 2007 2:32 am
by Bee-Ant
Hi...this is your request
hope help you
Posted:
Wed Aug 22, 2007 7:05 pm
by 98700
only two problems
1. they are going up
2. they are next to each other like ( . . ) that (one on each side of the ship)