Open Surge Forum

A fun 2D retro platformer inspired by Sonic games and a game creation system

You are not logged in.

Announcement

Our community has moved to Discord! https://discord.gg/w8JqM7m

#1 2012-01-05 23:26:16

SilverstepP
Member
From: North Carolina
Registered: 2009-07-31
Posts: 1,545

[Bug?] Clamp: Can't define minimum value as negative.

clamp($x, -160, 160)

X can equal anything, but this will still fail.

clamp($x, 0, 160)

And yet that works. Is this intended? Its a fairly easy work around with some subtraction, but I still noticed this.

Offline

#2 2012-01-05 23:28:14

Alexandre
Administrator
From: Brazil
Registered: 2009-01-27
Posts: 3,300
Website

Re: [Bug?] Clamp: Can't define minimum value as negative.

Please define "fail". A crash? An incorrect result?

what happens if you switch

clamp($x, -160, 160)

for

clamp($x, 0-160, 160)

???????

Offline

#3 2012-01-05 23:32:13

SilverstepP
Member
From: North Carolina
Registered: 2009-07-31
Posts: 1,545

Re: [Bug?] Clamp: Can't define minimum value as negative.

Alexandre wrote:

Please define "fail". A crash? An incorrect result?

what happens if you switch

clamp($x, -160, 160)

for

clamp($x, 0-160, 160)

???????

... it works if I do that.

Offline

#4 2012-01-05 23:34:30

Alexandre
Administrator
From: Brazil
Registered: 2009-01-27
Posts: 3,300
Website

Re: [Bug?] Clamp: Can't define minimum value as negative.

what fails?

Offline

#5 2012-01-05 23:39:51

SilverstepP
Member
From: North Carolina
Registered: 2009-07-31
Posts: 1,545

Re: [Bug?] Clamp: Can't define minimum value as negative.

I get a nanoparser error and it crashes

Nanocalc Error! Syntax Error near ' -120, 120)' in 'clamp($x, -120, 120)'!

Offline

Board footer

Powered by FluxBB  hosted by tuxfamily.org