Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Fireworks with meshes


https://gist.github.com/pepinganos/ca193701fa16ae2435e1

Touch the upper part of the screen to launch bombs.
Touch the lower part of the screen to launch rockets.

Comments

  • Jmv38Jmv38 Mod
    Posts: 3,297

    very nice. Thanks.

  • Posts: 289

    i love fireworks,amazing

  • Posts: 127

    Nice!

  • Posts: 256
    Is there a way that the fireworks can be generated automatically without the touch fx ? This will go good with the coding train #27 Fireworks.....With this video and PGM you can wrap your head around what's going on....the video is in java script, but it still has a function setup ( ) and a function draw ( )......and can be priced together......
  • Posts: 256
    This has an error msg :
    Asset strings ("planet cute star") are deprecated.
    Please use static assets, e.g., asset.
  • dave1707dave1707 Mod
    Posts: 9,432

    Any place you see an asset error, just tap on the name and reselect the name. It will correct itself.

  • Posts: 256
    This was a good PGM, but it didn't work on the i-phone with out some adjustments...I was able to make it fit on the i-phone screen by changing line 40, and changing the 180 to 30. But I'm having trouble taking out the touch fx and just looping the draw fx so I can just see the fireworks loop without touching. I tried stanching some lines from the touch fx and putting them in the draw fx, but I havent gotten anywhere yet. I tried looking at the coding train videos / fireworks, but was unable to transfer the java into lua...Does anyone have any ideas ? I would like to get this into my lua notebook.
  • Posts: 256
    I see this has two screen touch events, I'm going to try to put one of them into the draw fx and loop it from there...either one it doesn't matter....if I figure this out I'll post it just to share.....
  • Posts: 1,285

    Here’s a version that works on iPhones. Haven’t tested on iPads but since fireworks now calculate when to explode based on the screen height, it should still work.

  • Posts: 1,285

    Question: does anyone know how you could reproduce the fading-trails effect here without drawing over the entire background every time?

    In other words, does anyone know how to make this fireworks effect happen while still being able to see a background image behind it?

  • Posts: 887

    @UberGoober use Tint(r,g,b,a) and fade out the alpha value? The smoke in this demo does what you are after I think.

  • Posts: 1,285

    @West very very nice. I think I might use this for what I wanted to do instead of the fireworks code.

    I hope you don’t mind, I made a version that separates all the explosion code into an independent class, so that it’s easier to use in other projects.

  • edited May 12 Posts: 887

    @UberGoober yes no worries. For interest here is a small demo I made using a similar particle approach, but with greater environmental interaction.

    Tap the screen to boost, tilt the screen to rotate the ship. It might be a bit flakey as objects are tied to the iPad Pro screen dimensions rather than being universal

  • Posts: 1,285

    @West needs art or to be rejiggered to use built in assets.

  • Posts: 887

    @UberGoober Gah - they were on my Dropbox. That should be it updated. You’ll be pleased to know that for this one the assets are already in a spritesheet :-)

Sign In or Register to comment.