The Daily Click ::. Forums ::. Klik Coding Help ::. Query about scrolling frames
 

Post Reply  Post Oekaki 
 

Posted By Message

lembi2001



Registered
  01/04/2005
Points
  608

VIP MemberIt's-a me, Mario!Wii OwnerI like Aliens!Has Donated, Thank You!PS3 OwnerI am an April Fool
27th September, 2007 at 08:50:15 -

Hello, been a long time since i been here........... I am embarking on a brand new point and click game which involves the use of a srolling frame. I need to be able to control the scroll using the mouse. The problem i am having is getting a smooth scroll when the pointer is close to the edge of the screen. I also need to get it so that when the visible window reaches the end of the frame it wraps itself round the frame thus creating a sort of 360° view. is this possible in MMF2??

Thanks

 
n/a

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
27th September, 2007 at 10:14:24 -

sounds perfectly possible.

For the first part i suggest using an active object that scrolling in centered at. Then when the mouse goes to the left or right of the screen, the active object moves slowly left or right.

and getting it to wrap? um if you draw part of the left side of the frames background after the end of the right edge and part of the right background on the end of the left, you should be able to get the active object to quickly move from one edge to the other so it look like it's in the same place, see what i mean?

i hope i've explained that properly.

 
.

Pixelthief

Dedicated klik scientist

Registered
  02/01/2002
Points
  3419

Game of the Week WinnerWeekly Picture Me This Winner!You've Been Circy'd!VIP MemberI like Aliens!Evil klikerThe SpinsterI donated an open source project
27th September, 2007 at 11:04:48 -

Yes, the easiest way to do this, is to actually create perfect illusions on both sides of your screen. Say your window is 640 x 480; you would need a 320 pixel "fake area" on either side of the screen. So whenever your camera object reaches 320 pixels from the edge of the left or right screen, you set it to 320 pixels from the edge of the other side. Hence theres a small area on each side of the frame that you can never actually reach; it only serves as an optical illusion to give the scrolling effect. So you'd just need to make it perfectly lined up with what you'll see on the other side.

For example, in this level, whenever the player reaches one side of the room, hes teleported back to the other side:
Image
The areas on either side cannot actually be reached, but make the scrolling look smooth

 
Gridquest V2.00 is out!!
http://www.create-games.com/download.asp?id=7456

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
27th September, 2007 at 14:04:09 -

Oh good, what i said made sense then.

 
.

lembi2001



Registered
  01/04/2005
Points
  608

VIP MemberIt's-a me, Mario!Wii OwnerI like Aliens!Has Donated, Thank You!PS3 OwnerI am an April Fool
27th September, 2007 at 15:20:11 -

ok thanks for that i'll have a quick bash at it now but would it be possible for someone to post a small example of this for me to look at??? thanks

 
n/a

DaVince

This fool just HAD to have a custom rating

Registered
  04/09/2004
Points
  7998

Game of the Week WinnerClickzine StaffHas Donated, Thank You!Cardboard BoxDos Rules!
28th September, 2007 at 10:48:02 -

First, make the frame like Pixelthief explained. Then:

If X >= (Frame Width - (window width/2)): set X to (window width/2)

Where X = screen position. Same for Y.

 
Old member (~2004-2007).

Dave S.



Registered
  26/09/2003
Points
  924
15th November, 2007 at 16:54:45 -

DaVince... correct me if I'm wrong but I've worked out that the equation should read...

If X > (frame width - (window width/2)) then set X to (window width/6)
If X < (window width/2) then set X to (frame width - (window width/2))

If Y > (frame depth - (window depth/2)) then set Y to (window depth/6)
If Y < (window depth/2) then set Y to (frame depth - (window depth/2))

I tried this formula out on AndyUKs little demo and it worked a treat!



 
n/a
   

Post Reply



 



Advertisement

Worth A Click