Question about bullet behaviour

0 favourites
  • 5 posts
From the Asset Store
This pack contains 10 types of bullet effects, with different shapes and colors.
  • I have a game where you can launch a ball from the player to wherever the mouse is pointing(Using physics behaviour). I noticed that depending on how fast the player is moving when he launches the ball , the ball will differ in speed. I want the ball to always go at the same speed unless i otherwise specify(a powerup for example).

    I was thinking that Bullet might work this way, but does bullet support more than 8 directions? Also how would i go able making it so that when i click the left mouse button,

    the ball is shot in the direction of my mouse cursor the same way i would with the physics behaviour(Apply Physics impulse 1 towards Mouse.X , Mouse.Y)?

    If anybody sees this and has the answer, thanks!

    Paul

  • Everybody is too eager to apply physics behavior to projectiles, and objects in general I think, you can emulate most physics characteristics with bullet behavior alone, and you will get much better performance to boot...

    the bullet behavior allows full 360 rotation, acceleration, deceleration, bounce off solids, all of which can be controlled via variables...

  • Yeah i used the physics behaviour entirely through trial and error in getting it working. Mainly because i couldn't figure out how to use the bullet behaviour to do what i wanted.

    At the moment i would much prefer to use Bullet because i know i can set the speed i want it to go at, i just can't figure out a way of getting the ball to shoot in the direction of my mouse cursor. Also the bounce off solids part, Would i be able to toggle the objects collisions with the ball object depending on what Key I've pressed?

    I've been trying to do it all morning with Boolean's and variables but to no avail, I'm not too clued up on all of this yet! As it stands I've managed to make it collide when i want it to, then toggle it so that the object in question no longer has collisions enabled ,but it's like when i disable the collisions the first time i can't toggle it back. Which isn't what i want.

    I need it to collide when the ball is fired at it using the left mouse button, but to not collide and allow the ball to pass over whenever it is fired using the right.

    I hope I'm being clear enough, My thoughts are a little muddled trying to figure this out.

    Thanks for the swift reply.

    Paul

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • there are a few questions there and I'm not sure exactly what you are trying to do exactly, lets start with the mouse to begin you must have the bullet set angle to yes,on the properties bar to the left, it has a dropdown...

    after spawning the bullet to aim at the mouse x,y use "set angle to position" mouse.x,mouse.y

    I would need more info for the solids bit, but from what I'm hearing, a clone object that looks the same but has different properties that is switched when needed may be best way to go...

  • Thanks I'll give it a try, that clears things up a bit. Sorry i wasn't too concise there haha!

    Paul

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