Character and camera focus

Post your own tutorials, guides and demos.

Post » Sat May 28, 2011 1:38 am

Multiple characters selection and camera focus little example.
I know its a really silly example,but it could be usefull for beginners.

It works this way:
-There's 2 sprites,representing our characters,Kitty and Floating head,With the platform behavior attached.Both have a private variable called "gotFocus" with its value set to 0.
-There's also an empty sprite called Camera,with the option "Center view on me" chequed.
-An "allways" event for each sprite cheks the value from GotFocus,if its equal or greater than 1,it moves the sprite Camera to the position of Kitty or Floating Head.It also moves the Focus sprite and send the character to the front,in case it overlaps the other char.
-Finally,there's 2 keyboard events:j & k,each one deactivates and activates the platform movement for each char,and sets its own GotFocus variable to 1 and the GotFocus on the other sprite to 0.
-An Start of layout event determines wich char get the focus first and deactivates the other.In this case,its Kitty who get the focus...ladies first,gentlemen XD.

Well..I hope this work for you...DOWNLOAD LINK BELLOW

Sorry about my terrible inglish,by the way :roll:
Posts: 4
Reputation: 840

Return to Your tutorials & example files

Who is online

Users browsing this forum: No registered users and 1 guest