How to do this Enemy-Bullet configuration? [SOLVED]

For questions about using Classic.

Post » Sat Mar 19, 2011 7:29 pm

.CAP file in question

What I would like to happen:


An enemy I have in a spaceship horizontal-scrolling game has the set movement pattern of up-and-down.

While it is traveling down, I have set its private variable "BulletTime" to 1.

IF BulletTime is 1, and IF the Enemy's Y is equal to the Player's Y, it should spawn a bullet "Ray"
If the player's X is less than Enemy, "Ray" moves at angle 180.
If the player's X is greater, "Ray" moves at angle 0.
However, this should only happen once per cycle; I don't want to have a sheet of bullets following my player (this is what happens when I set the parameters to anything BUT Player.Y = Enemy.Y).


What DOES happen
:

The enemy moves down, and then fires the "Ray", but only does so once in its entire movement cycle. Naturally to avoid getting hit, the player will have to move out of the way, but once the player moves out of its initial position, the enemy will not fire again.



What my events look like:
NOTE -If you wish to look at a .CAP, just ask, if this isn't helping-
NOTE2 -the private variable 'Border' determines which direction the enemy moves in

Check out my VGM on my soundcloud page!
Video-Game Music: E.C.2151
B
7
S
2
G
2
Posts: 193
Reputation: 1,561

Post » Sat Mar 19, 2011 7:54 pm

yeah post cap, can't tell from that
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Sat Mar 19, 2011 7:59 pm

Updated. The area in question is Layout "L3", with the event sheet "Enemies"
Check out my VGM on my soundcloud page!
Video-Game Music: E.C.2151
B
7
S
2
G
2
Posts: 193
Reputation: 1,561

Post » Sat Mar 19, 2011 8:39 pm

Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Sat Mar 19, 2011 8:49 pm

Tested it out and that worked like a charm!

I am pretty limited in my knowledge of certain C.0X functions, so the thought to use absolute values in System CompareValues never crossed my mind.

Thanks a whole bunch!
Check out my VGM on my soundcloud page!
Video-Game Music: E.C.2151
B
7
S
2
G
2
Posts: 193
Reputation: 1,561


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 7 guests