1

**Advanced Technical Forum / Re: Is there a function that tints the *entire room* (background)**

« **on:**19 Jun 2018, 21:36 »

Just re the candlelight code:

1. if the player picks up one of these items, then uses (and loses) it elsewhere, it will appear back in the room (unless that's what you want, of course)

2. distance in a 2D coordinate system:

1. if the player picks up one of these items, then uses (and loses) it elsewhere, it will appear back in the room (unless that's what you want, of course)

2. distance in a 2D coordinate system:

Code: Adventure Game Studio

- float dx = IntToFloat(mouse.x - Obj.X), dy = IntToFloat(mouse.y - Obj.Y);
- int dist = FloatToInt(Math.Sqrt(dx * dx + dy * dy), eRoundNearest);
- int trans = (dist <= 100) * dist + (dist > 100) * 100; // the multiplication casts the bools to 1 or 0