The Daily Click ::. Forums ::. Klik Coding Help ::. My Scrolling Example
 

Post Reply  Post Oekaki 
 

Posted By Message

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
18th May, 2011 at 05:48:46 -

I've made an example where the camera hangs in front of the player, depending on what direction they are facing.

I know Zephni's scrolling engine has this effect. I had a look at his example and it is great. But there was too much extra stuff I didn't need for my particular project. So I made this method.

It uses a bouncing ball object for the camera.
7 lines of code for the camera.
6 lines to fix a glitch in the MMF default platform movement (not needed if you create your own custom movement)

This is perfect for my current project and hopefully it will help somebody else too.

http://www.whenthereisnoroominhellthedeadwalktheearth.com/MMF/ScrollingExampleByChrisBurrows.zip

Image

 
n/a

The Chris Street

Administrator
Unspeakably Lazy Admin

Registered
  14/05/2002
Points
  48488

Game of the Week WinnerClickzine StaffAcoders MemberKlikCast StarVIP MemberPicture Me This Round 35 Winner!Second GOTW AwardYou've Been Circy'd!Picture Me This Round 38 Winner!GOTM December Third Place!!
I am an April FoolKliktober Special Award Tag
18th May, 2011 at 09:49:36 -

Thats one way to do it, but its possible to achieve this another way. Off the top of my head and in three events:

ALWAYS:
Set X frame to X Position Of Player + Alterable Value D
Set Y frame to Y Position Of Player


Player is looking RIGHT and
Alterable Value D is LOWER than 40:
Add 2 to Alterable Value D


Player is looking LEFT and
Alterable Value D is GREATER than -40:
Subtract 2 from Alterable Value D

 
n/a

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
18th May, 2011 at 10:10:40 -

Oh nice. I'll try it out.

Using the bouncing ball is handy though for making the camera look at another object. Like scroll up into the air and look at an eagle or something. Cause you can just say "Look at object" and it works real well if the object is at an angle other than a vertical or horizontal line. I know this can be done with math. But anyway I like my method. Thanks for sharing yours too!

 
n/a
   

Post Reply



 



Advertisement

Worth A Click