Need help with a couple of things please.

Get help using Construct 2

Post » Thu May 28, 2015 8:51 am

Hi all,
I'm new at using Construct 2 and I'm trying to do a simple game. It is indeed a simple idea, but as I'm NOT a Construct 2 expert I can't understand which is the best way to do some stuff, so I end up doing strange workarounds that suck.

So this is the setting of the game:
- I have a character on the right side of the screen that can only move up and down and shoot ONLY towards the right side of the screen.
- Enemies come from the right side of the screen in a straight line, and if they get to the left end of the screen you lose some health. ( basically like a tower defense without towers).
- I'm still thinking about the enemy spawns. Not sure if I will put enemy waves with an upgrade shop between waves, or 1 huge wave with increasing difficulty and a button to open the upgrade shop whenever you want.

Here come the PROBLEMS:
1) I put an "enrage" status for the enemies, which triggers randomly on an enemy on screen every certain period of time. "Enrage" causes the enemy to change animation and go faster. What I can't seem to do correctly is spawn a flame animation behind the enemy's aircraft (to give the impression of a boost) ONLY when they get enraged. On event 12 of the event sheet in the uploaded picture you can see what happens when an enemy becomes enraged. There i had a "spawn EngineBoost" but the result was a trail of sprites behind the moving enemy (obviously, because the enemy keeps being enraged and alive, so that event keeps playing).What is the best way to implement this thing?

2) I haven't totally tried this yet, but I don't want to mess up the code before getting advice. How should I manage the enemy waves? which is the best way to write these events? (possibily analyzing both "wave" modes that i wrote above)

Sorry about the long post. I hope someone can help me, and thanks in advance!! :D

EDIT: Forgot to post the Screenshot, silly me :P
Image
Last edited by KaitoX92 on Thu May 28, 2015 9:27 am, edited 1 time in total.
B
5
Posts: 5
Reputation: 233

Post » Thu May 28, 2015 9:16 am

1) You could perhaps have your 'boost' animation pinned to your enemy aircraft, instead of spawning it, and when the enemy becomes enraged you could then unhide the boost animation. Then you cold hide it again whilst the enemy is no longer enraged.

2) You could make it easy for yourself and set up the whole wave system to trigger on a time basis. For example, 5 seconds in spawn these guys, then 10 seconds in spawn these guys, etc...
Check out the simple timer on here: https://www.scirra.com/tutorials/450/timers and then you could check the time and then spawn when appropriate.
B
9
S
3
G
1
Posts: 53
Reputation: 1,296

Post » Thu May 28, 2015 1:07 pm

Thank you for your fast reply galacticfan!

1) But when I spawn an enemy, will the pinned sprite spawn with it? Does it become part of the instance? or do I have to spawn a bunch of 'boost' sprits out of the layout and then pin one to the spawned enemy?

2)I will check the link you sent me right away and write back. But I already have a spawn family with 8 spawns that works at random intervals.. what I was actually asking is how could I do a wave system similar to a tower defense game: meaning a wave with 30 enemies starts > enemies spawn at determined intervals > when "EnemiesRemaining=0" pause the game > open the shop> on input close the shop and start next wave on SAME layout. Is it possible? if yes, how please?
B
5
Posts: 5
Reputation: 233

Post » Thu May 28, 2015 1:31 pm

A simple action like this would solve question1:

On enemy created -
>enemy spawn boost at enemy.x,enemy.y
> boost pin to enemy
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu May 28, 2015 4:07 pm

ok I got point 1) to ALMOST work. I pinned the boost at the enemies, set it invisible, and when the enemy is enraged it becomes visible for ALL enemies on screen. This is a problem. I want it to be visibile ONLY on the enraged enemy (which will be 1 out of a bunch at the beginning, and possibly also more on screen at the same time).
The only option I can put is "Set Visible", but this doesn't let me choose which boost to be visible. How can I solve this pleasE? Thank you
B
5
Posts: 5
Reputation: 233

Post » Thu May 28, 2015 4:53 pm

give the boost an instance variable enemyuid

On enemy created -
>enemy spawn boost at enemy.x,enemy.y
> boost pin to enemy
> boost set variable enemyuid = enemy.uid

When enemy gets enraged
system pick by comparison boost where boost.enemyuid = enemy.uid
> boost set visible
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Jun 07, 2015 6:05 pm

I did it without a UID. Thank you very much!
B
5
Posts: 5
Reputation: 233


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 25 guests