How do I fix this create object issue

0 favourites
  • 9 posts
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • 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

    [attachment=0:335cqyfi][/attachment:335cqyfi]

    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.

  • 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.

  • 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.

  • 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.

  • 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!!

  • really fun game...

    imralr .....just a few suggestions...

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • lol korbaach that is awesome! That is just what it needed.

    [quote:dki320xl]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..

  • That is just what it needed.

    Hey chrisinfinger don't peek...

    just kidding.....

    Nothing special .. I'm just a bit optimized "Event sheet"

    there is still much space for improvement....

  • 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!!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)