How do I fix this create object issue

Get help using Construct 2

Post » Thu Oct 23, 2014 3:36 pm

Hi All,

I am new with Construct 2, currently I am making a game where a bullet-avoiding game where a player must avoids the enemies/bullets coming at the player.

The player will gain life each time it contact with the bullet with the same color as the player. The player starts with one life and each friendly bullet adds one life to the player, after it reached certain number the player will be able to use a bomb which decrease all the player's life (back to one) but also destroy all enemies on screen.

I make the enemies on random by setting the system condition on every 5 seconds the system will create object (the enemies) on just outside of the border area.

I manage to create most of the basic ideas to my game, however there is this one thing that keeps my game unplayable.

The bomb discussed above is an expanding circle starting from the player's position to fill the screen and disappear, like this


bomb.gif



The bomb i make in the game is kinda like that. I make it with making global variables and set the system condition to global variables = 1 the action for sprite is set sprite.widht+25 and sprite.height+25.
It gets the job done but I'm still working on making it like the gif.

The problem then starts. I wanted to make that when the sprite is expanding and colliding with the enemies on the screen, the enemies is destroyed. I did that.

But, after the bomb is used, the enemies wont spawning again. before the bomb is used, the enemies is spawning every five seconds. but after I use the bomb and the enemies on screen is destroyed, the enemies wont spawning again.

Could anyone help me to fix this please?

Thanks in advance. Cheers.
You do not have the required permissions to view the files attached to this post.
B
3
Posts: 8
Reputation: 462

Post » Thu Oct 23, 2014 6:31 pm

Are you ever destroying the bomb sprite? If you don't destroy the bomb sprite, then it could be covering the enemy spawn points and they will be destroyed as soon as they spawn.

Other than that, I can't think of any solutions unless I can see what you're doing. I'd suggest posting a CAPX - simplified, if possible - so we can get a better idea of what's going on.
Moderator
B
113
S
41
G
20
Posts: 1,586
Reputation: 19,126

Post » Sat Oct 25, 2014 4:20 am

Hai Linkman!!

Yup, I did make the bomb sprite behavior set to be destroyed outside layout. I also make such in the event sheet (bomb sprite is outside layout bomb sprite is destroyed). But nothing work.

Here's the game capx. Your help (and any feedback towards the game) would be greatly appreciated.
You do not have the required permissions to view the files attached to this post.
B
3
Posts: 8
Reputation: 462

Post » Sat Oct 25, 2014 7:31 am

Let me start by saying, very neat idea and fun game.

I took a look at it and got it working for you. The problem with the way you were doing it is that you were creating the sprite that made the orb but never destroying it. Yes, you had it set to destroy outside layout, however, it never technically left the layout. It just kept growing and growing and growing....
I used your explosion variable and set it to 0 at start then had your hitpoints >= 6 event turn it to 1 which triggers the orb then waits 2 seconds and then destroys it and sets explosion back to 0. I also reset the explosion variable if you die and reset game, this way its always ready to be changed by bomb trigger event.

I didn't like how the original 4 instances were always coming on screen at start of game from same place so I corralled them for you where they are terminated when game starts (they only have to be present when level is loaded). You can always free them and delete the kill sprite if you don't like it.

Since I played the #$^% out of your level to test my work (and its kinda challenging if you miss the first 5 red orbs) I have the following critique:
1. When I made red orbs worth 2 health to make debugging easier it seemed more fun... maybe make them worth 1.5 will feel same and work with existing art. Try it and see what I mean.
2. With the enemy orbs never destroying themselves it eventually gets too crowded to move, maybe make a % chance when two orbs of the same color collide they destroy each other.. this might allow player to last long enough to set off more than one bomb. :)
You do not have the required permissions to view the files attached to this post.
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
71
S
19
G
8
Posts: 640
Reputation: 9,701

Post » Sat Oct 25, 2014 1:48 pm

Wow!!

Thank you so much Master!! (can I call you that?)

You really don't know how much your appreciation lift my spirits man.

Thanks again!!
B
3
Posts: 8
Reputation: 462

Post » Sat Oct 25, 2014 3:52 pm

really fun game... :D
imralr .....just a few suggestions...
You do not have the required permissions to view the files attached to this post.
Last edited by korbaach on Sat Oct 25, 2014 6:28 pm, edited 1 time in total.
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Sat Oct 25, 2014 5:33 pm

lol korbaach that is awesome! That is just what it needed. :)

Thank you so much Master!! (can I call you that?)


I am no master by any means, I just kinda "get" Construct2 logic building for some reason (even though coding has never been a strong suit of mine).
I like making it work in ways programmers don't think about, see my turn based project that doesn't use arrays, grid, or tiles.. :)
turn-based-strategy-no-array-or-tiles_t118081
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
71
S
19
G
8
Posts: 640
Reputation: 9,701

Post » Sat Oct 25, 2014 6:09 pm

chrisinfinger wrote: That is just what it needed. :)


Hey chrisinfinger don't peek...

just kidding..... :D

Nothing special .. I'm just a bit optimized "Event sheet" :D
there is still much space for improvement....
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Sun Oct 26, 2014 7:51 am

Hai Korbaach!!

Thanks man!! You're giving me so much idea on how to improve the game.

I'll make sure I'm going to conjure something playable at least with this.

Thanks again!!
B
3
Posts: 8
Reputation: 462


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot], LunaticCat and 2 guests