MIN and MAX with constrain attributes

Sold By: : GSHelper Category:

Description

Here is how to set a min and max for locations with a constrain attribute. A much better system then using walls.
here is the code used ..

constrain attribute self.position.x to max((0+( self.Size.Height /2)),min((480-( self.Size.Width /2)), game.Mouse.Position.X ))
constrain attribute self.position.y to max((0+( self.Size.Height /2)),min((320-( self.Size.Height /2)), game.Mouse.Position.Y ))

Here is the file to DOWNLOAD

 

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.