How do I round damage

Get help using Construct 2

Post » Fri Jul 08, 2016 8:59 am

Just a quick question here is my battle calculation for damage in my game

(p1.atk/2)+((p1.atk/2*(p1.atk/Enemy.def)))+floor(random(1,4))

And then i subtract damage from the enemy HP.

But i would like to end up with only whole numbers.... how do i go about doing that?
B
3
Posts: 8
Reputation: 191

Post » Fri Jul 08, 2016 9:27 am

Use the system expression int() or round() or ceil() or floor() according to what you exactly want your result to look like and place your formula within the parenthesis.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
289
S
112
G
94
Posts: 7,333
Reputation: 69,287


Return to How do I....?

Who is online

Users browsing this forum: luckyrawatlucky, shawnzien and 7 guests