The Daily Click ::. Forums ::. Klik Coding Help ::. How to do the zelda style scrolling
 

Post Reply  Post Oekaki 
 

Posted By Message

MBK



Registered
  07/06/2007
Points
  1578

VIP Member
20th May, 2010 at 04:10:16 -

So that's all you wanted? That's more like my earlier version before I added in the bit that makes it slowly scroll to the next screen.
That's a bit like Kirby isn't it? ... not Zelda.
It's just the Zelda style but without that little extra that makes it move over with the camera instead of jumping straight over.

All you have to do is make a camera active, and set the screen to always center on it, then only move it when you reach the edge of the screen. And when you do reach that edge, you should have xmin, xmax, ymin, and ymax variables, and add to them the first screen size (between 0 and whatever) when you go right, and delete that when you go left. Same for up and down but using the ymin and ymax.
Oh, and always set the camera active to half of the xmax for x and half of the ymax for y.
Come to think of it, you may not even need the mins when doing it this way, just the max's.
The code I made used both so I'm not sure if it matters or not.

Yea, I wanted that original Knytt source too, never did find it btw.


 
Click Me! http://www.create-games.com/project.asp?view=main&id=1444

http://www.mediafire.com/download.php?aoo1dnnlq5i

Blood of the Ancient One, Seen only as Shadow, Faster than Lightning, Fierce as the Greatest Dragon, Nearly Invisible, Floating in a Dream, Entered through the Demon Door, Destroyer of Evil in a Realm with a Red Sky Scarred, Who could I be ?

Jon C-B

I create vaporware

Registered
  23/04/2008
Points
  237

I'm an alien!VIP MemberWii OwnerI donated an open source project Santa Hat
21st May, 2010 at 01:23:31 -

Oh i actually did find one, but its worked into the code of the whole game... its quite frustrating there was just one simple math code that did this!

 
n/a

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49567

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
21st May, 2010 at 16:46:40 -

It depends on the resolution of your game.

Assuming your game is in the 640x480 resolution this is what you do.

Always
-set horizontal scroll position to: 320+(X("player")/640)*640
-set verticle scroll position to: 240+(Y("player")/480)*480

that will work.

 
n/a

Jon C-B

I create vaporware

Registered
  23/04/2008
Points
  237

I'm an alien!VIP MemberWii OwnerI donated an open source project Santa Hat
21st May, 2010 at 22:01:55 -

The window size is 480 x 320. But when i put it in and run it the screen starts shaking

 
n/a

Mkingy



Registered
  05/07/2003
Points
  4771

Box Blue
21st May, 2010 at 22:14:43 -

so using Urbanmonk's solution:

Always
-set horizontal scroll position to: 240+(X("player")/480)*480
-set verticle scroll position to: 160+(Y("player")/320)*320

I just tried it and it works fine, you must have mistyped something, or got duplicate scrolling events...

 
n/a

Jon C-B

I create vaporware

Registered
  23/04/2008
Points
  237

I'm an alien!VIP MemberWii OwnerI donated an open source project Santa Hat
21st May, 2010 at 22:23:42 -

same thing happening. here ill show you
http://www.mediafire.com/?tdzmqtck05h

 
n/a

Mkingy



Registered
  05/07/2003
Points
  4771

Box Blue
21st May, 2010 at 22:42:15 -

Group platform engine => movement

You've got a scrolling event setting the display to -60 of the player

Delete it!

 
n/a

Jon C-B

I create vaporware

Registered
  23/04/2008
Points
  237

I'm an alien!VIP MemberWii OwnerI donated an open source project Santa Hat
22nd May, 2010 at 00:29:02 -

i dont understnd what you mean...

 
n/a

Jon C-B

I create vaporware

Registered
  23/04/2008
Points
  237

I'm an alien!VIP MemberWii OwnerI donated an open source project Santa Hat
22nd May, 2010 at 19:39:27 -

Oh i see now thank you very much!

 
n/a
   

Post Reply



 



Advertisement

Worth A Click