Shooting effect?

Hi touch peeps - I’m trying to create an asteroids like game and I want to have the player be able to shoot from the tip of a geometry. I was thinking something with particles or instancing, but I’m not quite sure how to get the behavior correct. Any thoughts? I’ve attached a tox for reference.

Thanks!
B
asteroids help.tox (3.41 KB)

See example:
asteroids1.tox (5.53 KB)

-Make modular by removing joystick and use channel bundles This way any input source can be used once renamed to tx ty tz and shoot

-begin with the ship facing forward

  • Manually use a trim chop to find the top edge of the ship, use this as the barrel
    -Make a separate geo for fire and projectile
    -Connect ship to other geos with container wires to use as master transform

-Modify parameters of patterns, waves and filters and limitsop to make different weapons, you could also use instancing instead of limitsop in both cases

cam2 is something closer to what you might use in a game, cam1 follows the ship

amazing, thank you! I hacked something together using the event chop but this is a lot cleaner. thanks again!

Unless it’s really (instantaneously) fast, bullets should not be parented to the ship but should be autonomous in the direction they where fired. It will be especially obvious when you’ll make the ship move / rotate.

I would either dynamically spawn a null at the position fired with the parented bullet distancing itself from it, or use particles instead which IMO might make more sense.

Been thinkering a bit in the last hour about this. Network is a mess and not really self explanatory, but i’m sharing anyway it might help a bit.

Collision detection will be a problem.
I’m thinking that if bullets/particles are converted to chops samples (and then instanced) you could detect those that stopped moving (collisions). Use python scripts to trigger an animation in that position, or a use renderpick to figure out what’s the current geo at that u v and replace it with two smaller chunks…etc.

Collision of the ship vs asteroids could be done in render passes. Make both full white, merge them at 50% opacity, whenever you have a white pixel you know that the ship had a collision.

I’m not sure about the best way to tackle these things currently in TD. If someone has better ways i’m all ears :slight_smile:

linked toe file has u v movement, rotation, bullets based on particles and particle (sticky) collision with asteroids.
asteroids_test.toe (15.7 KB)

Programmer colleague says he would do it all in python, check the state of every frame…etc. Maybe use 2d collision detection like box2d.