Forums

OverviewFelgo 2 Support (Qt 5) › Tip for explosion?

Tagged: 

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #15719

    Isak

    Hello Everyone,

    I have come to the point where i need my enemies in my game to explode but dont really know how to do this? My game is a pixel games so it dont need to be so advanced i just need to spawn like 20 small boxes(pixels) and shoot them in all directions. But dont know how to start, in my collider i have:

     

    fixture.onBeginContact and where i remove the entity but i also need this explosions. Does anybody have a tip to get me started?

     

    Kindly

     

    /Isak

    #15732

    Günther
    Felgo Team

    Hi Isak,

    There are many possible solutions depending on how you want the effect to look like, e.g. with the use of sprites, a particle effect, QML Animations or physics.
    I followed up on this question via email, please have a look!

    Best,
    Günther

    #15735

    Darren

    Hi Isak,

    You want to create 20 small boxes for your explosion and send them in different directions?

    I would create an Explosion object and immediately before destroying the enemy entity, would create the boxes dynamically.

    Within my explosion object I would have a timer, so it would destroy itself after a short period.  I would also set a random direction for it to travel in when it is created.

    I found how to create objects dynamically through this link: http://doc.qt.io/qt-5/qtqml-javascript-dynamicobjectcreation.html.

     

    An easier solution would be to use the AnimatedSpriteVPlay object. https://felgo.com/doc/vplay-animatedspritevplay/

    This enables you to loop through a number of images to animate your explosion.  You would just create one of these when your enemy explodes, and have it destroy itself once it has looped through all the images.

    I hope that’s not too simplistic for you and helps.

    Good luck

    Darren.

    #15737

    Darren

    Forget what I said about creating objects dynamically Isak – unless you want to make your exploding boxes into entities and bounce them off things.  You would be better using a particle effect as Gunther suggested. I don’t know what I was thinking when I suggested those boxes….

    #16458

    Isak

    Hello,

     

    I would like to use particles for an explosion and tested the particle editor example but it only seems to use a fire and when i try the other particles nothing happens, can you change it to show exploding boxes? My games is kind of pixelgame so just a bunch of boxes exploding out would suit my needs.

    #16460

    Günther
    Felgo Team

    Hi Isak!

    The ParticleEditor contains many different examples of particles. Each of the uses a

    • particle configuration (how the particles are spread with speed direction, start / end color, etc …)
    • particle texture (image that is used for each particle)

    You can create your custom particle effect by using your texture (of a pixel box) and configuring the particle properties however you see fit.

    Best,
    Günther

    #16465

    Christian
    Felgo Team

    Hi Isak, one more thing to consider: You also need to click on the “Add Particle” button after you selected the particle effect to add this one to the scene.

    Cheers, Chris

    #16466

    Isak

    feldifux said:

    Hi Isak, one more thing to consider: You also need to click on the “Add Particle” button after you selected the particle effect to add this one to the scene.

    Cheers, Chris

    Hello Christian,

    The problem seems to be that i cant change from the fireparticles? if i click on the different ones nothing happens. And if i click on custom particles i get this error message : ShellExecute ‘file:///C:/Users/isakc/Documents/ParticleEditorDev/particles/’ failed (error 2).

     

    Am i doing something wrong?

     

     

    #16467

    Christian
    Felgo Team

    Can you record a video and share the link here?

    #16468

    Isak

    Hello Christian, Any windows app i can use to record?

    But is it maybe that i have the personal license that is the problem? it says:

    Felgo Plugin Trial – upgrade your license at https://felgo.com/upgradeLicense for full plugin access and activate the used plugins with a valid licens key?

    Do i need the pro license to use the particle plugin?

     

     

     

    #16477

    Günther
    Felgo Team

    Hi Isak!

    ParticleEditor is usable for all users and licenses.
    Are you running the ParticleEditor example using SampleLauncher, or did you open the ParticleEditor project to build and run the ParticleEditor from Qt Creator?

    In case you only tried one option, can you try the SampleLauncher or building with Qt Creator as well to see if this works then?

    Best,
    Günther

Viewing 11 posts - 1 through 11 (of 11 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support