Jump to content

Reflecting Projectile


Powerhorst
 Share

Recommended Posts

Hey guys,

 

So I'm currently trying out Leadwerks during my free-time and must say, I'm really happy with it.

 

As my first Learning-project I want to create a simple BrickOut-Clone

(Maybe better known as "that Pong-game where you try to destroy blocks")

 

Now most of this works out fine for me and I'm starting to understand the engine-concepts but I can't seem to get the ball-behaviour right.

 

Usually in those games the ball hits a barrier or the player-paddle and reflects its direction without losing any of its velocity.

 

post-14234-0-76087500-1424535611.png

 

If it choose to make the ball a rigidbody the reflections will happen without any problems (thanks to the colliders) but it will naturally lose its velocity thanks to the impact.

 

Do you know any ways to prevent this from happening?

It seems like I'm only lacking a simple command line to get this done.

Something like rigidbody.KeepForce or rigidbody.SetElasticity

 

 

 

Thanks in advance for any help happy.png

 

Greets

Link to comment
Share on other sites

You can set the velocity to the value just before the impact happened.

The problem is velocity will stay constant.

 

I don't know if there is a way to tell the objects to behave like normal after we set the velocity ? I mean you set the velocity that stays constant , than calling a function the object would loose velocity behaving like normal physics ?

Stop toying and make games

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...