lots of collision boxes and overlays!

This forum is currently in read-only mode.
  • I'm messing around with bullets, lots of bullets!

    I know that customisable bounding boxes aren't featured yet, which would instantly solve my problem, but, at present whats the best way to shoot a very large amount of box bullets with an object attached to it, so I get my graphics looking right with a correctly sized bounding box attached to it?

    also, because i'm spawning both a graphic and a collision box, and doubling the graphics per bullet I guess this will hammer the framerate?

    thanks as always, construct is turning into a total weapon!!

  • I don't really understand what you mean by this:

    whats the best way to shoot a very large amount of box bullets with an object attached to it, so I get my graphics looking right with a correctly sized bounding box attached to it?

    But I'm guessing you want to make little collision detectors around an oddly-shaped object? Why don't you just use Per Pixel collision? Or if your object is too detailed, make a separate less detailed sprite that's roughly the same shape and use that as it's Per Pixel collision.

    And if that doesn't help you out, maybe try explaining what you're doing a little better.

    And you shouldn't really see any big difference in framerate until you have a couple thousand things on the screen, unless they have effects applied to them, or they're like physics objects or whatever.

  • my apologies for not explaining so well

    I'd like to make the collision area of my bullets smaller than the actual area that the bullets really are.

    but I was unsure of the best way to create a new bullet object on each collision box.

  • You could try just setting the bullet's collision type to 'Point'. This means they only register a collision if their hot spot is overlapping something else.

  • tried that before, but its a bit TOO small.. :/

    *edit*

    stupid question deleted.

  • A very simple solution that doesn't use any detectors at all:

    http://www.fileshack.us/get_file.php?id ... hitbox.cap

    The "bullet" (in this case, the big blue square) has two animations, one that is it's "display" animation which gets drawn to the screen, and the other which is it's "hitbox" animation that does the collision. The hitbox animation is smaller than the display animation (32x32).

    Before doing any collision checks with the player, set the animation of the bullet to "collision." After checking collision events, set it back to "display" so that Construct will draw the correct sprite. Construct only draws the screen after all the events have run, so you will never see the bullet showing it's collision box animation.

    In this example you can see that even though the player (brown box) can walk onto the "bullet," he doesn't get knocked away unless he touches the center of it.

    This should do exactly what you need it to do, and in fact would be a good way to do custom detectors in general without using separate objects.

  • Perhaps an addition can be made as well to the point collision system to include image points added to the Sprite.

    Then no additional animations would be needed to expand the point slightly.

  • Perhaps an addition can be made as well to the point collision system to include image points added to the Sprite.

    Then no additional animations would be needed to expand the point slightly.

    You can already do this.

    +System: Sprite collides with point at Sprite2.ImagePointX("colliderpoint1"), Sprite2.ImagePointY("colliderpoint1")
    
    +System: Sprite collides with point at Sprite2.ImagePointX("colliderpoint2"), Sprite2.ImagePointY("colliderpoint2")
    
    etc, etc, repeat for all image points
    [/code:1mwlxpc5]
    
    But I hardly think that's easier than my way.
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • No I know you can do it, I meant an addition to the internal workings thus not needing any events at all. Just a checkbox.

    But no, it's not a huge difference in efficiency, I just like to point out possibilities.

  • thanks deadeye, thats an exellent way of solving the problem!

    *gets back to work*

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