GSHelper

  • Home
  • All Templates
    • Bundle Deals
    • Complete Games
    • Core Controls
    • App Store Best Sellers
    • Game Team One
    • GSHelper Originals
    • DeepBlueApps
    • Art
      • Art Packs
    • Music
      • Music Packs
      • Music Tracks
      • Tools
  • Free Demos
    • Armelline’s Templates
    • FireMapleGames
    • ORBZ
  • My Account
    • Vendors
  • Contact Us
✕

MIN and MAX with constrain attributes

Jonathan Francois Jonathan Francois May 16, 2011

Sold By: : GSHelper Category: Free Videos and $1 Templates
  • Description

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

 

Related products

  • Pace back and forth between 2 spots in gamesalad

    Rated 0 out of 5
    Sold By: : GSHelper
    Read more
  • Illustrator Auto trace example

    Rated 0 out of 5
    Sold By: : GSHelper
    Read more
  • Time scores in Gamecenter

    Rated 0 out of 5
    Sold By: : GSHelper
    Read more
  • Getting GameCenter set up in your games

    Rated 0 out of 5
    Sold By: : GSHelper
    Read more
Jonathan Francois

Author: Jonathan Francois

Previous Article

Destroy the oldest Ball shot in gamesalad

Next Article

Pace back and forth between 2 spots in gamesalad

Leave a Reply Cancel reply

You must be logged in to post a comment.

Latest Posts

Terms and Conditions

Screenshots! A Developers Silent Pain

Need Assistance?

Use our support desk for help with any template purchase, or if you would like a quote for custom development
Arba WordPress Theme by XstreamThemes.