The Daily Click ::. Forums ::. Klik Coding Help ::. Basic scrolling question
 

Post Reply  Post Oekaki 
 

Posted By Message

antium



Registered
  10/09/2004
Points
  7
12th September, 2004 at 13:36:33 -

Hi, this will sound really basic to you guys, but I'm new to MMF, so bear with me

I'm trying to make a 1942 style game - where the screen is always moving up, finding new enemys/scenery, but you move around independantly shooting.

The only way I can find to make the screen scroll up is to create an invisible active object, and 'Center display at (0,0) from object'. I then make the object follow a path up to the top of the screen. The screen will then seemingly then move through the level on it's own, which is what I want.

When I then insert my fighter plane, I can find no way of making sure it stays on the screen. It stops if it goes off the play area to the left or right, but it can fly to far forward or back, and just dissapear off. How can I make sure it stays on the screen, not just on the play area?

Am I doing this the long way round? Is there a more effective way to make this type of game?

Thanks in advance.

 
n/a

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
12th September, 2004 at 13:39:59 -

Ok, here's a basic way to do it,

Every .02 seconds - subtract 1(this is how many pixel you want it to scrool each time it loops) from the planes Y coord
Always - Center display 0,0 from plane

 
Craps, I'm an old man!

antium



Registered
  10/09/2004
Points
  7
12th September, 2004 at 13:52:14 -

Hi, thanks for the quick answer.

The only part I don't understand from your answer is where to find the option to subtract 1 (special conditions/storyboard controls/etc).

 
n/a

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
12th September, 2004 at 14:00:05 -

set y position to y.player - 1

 
Craps, I'm an old man!

antium



Registered
  10/09/2004
Points
  7
12th September, 2004 at 14:21:57 -

Ah, nice one... The screen now moves up on it's own like I want it to, but if the player goes down, the screen moves down aswell. Is there a way to make the screen carry on moving up (at a set speed) even when the player goes to the bottom (or top for that matter) of the screen?

 
n/a

antium



Registered
  10/09/2004
Points
  7
12th September, 2004 at 14:26:21 -

It's probably not worth starting a new topic for so I'll ask here.

Also, is there any reason my I can't see all of the play area (frame) on the frame editor? If I make the play area bigger than the set size, then most of the time I can't see the bottom of it, as the scrollbars won't go don't far enough.

It's hard to explain what I mean:S

 
n/a

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
12th September, 2004 at 14:29:04 -

That's where you're going to run into some problems, you'd have to code a custom movement for it. or you could try making an object that always sits behind the screen, and just tell your ship to bounce off it. To do that you'd use your forst method for scrolling but instead of having the object in the middle of the screen, you'd have it at the bottom and tell the display to always center from the center of your bar plus whatever hieght it takes to keep the bar on the bottom of the screen while being invisible.

 
Craps, I'm an old man!

antium



Registered
  10/09/2004
Points
  7
12th September, 2004 at 14:30:21 -

Forget the second question, I've just figured it out, by changing the margins... lol.

 
n/a

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
12th September, 2004 at 14:32:12 -

Cool, well glad I could help.

 
Craps, I'm an old man!

antium



Registered
  10/09/2004
Points
  7
12th September, 2004 at 14:32:25 -

Ok, I'll keep playing about and see what I can come up with. Thanks for showing me how to auto-scoll the screen

 
n/a

Tigerworks

Klik Legend

Registered
  15/01/2002
Points
  3882
12th September, 2004 at 16:11:20 -

Use the invisible active method to always scroll the screen, but also have the event:

+ Y("Plane object") is lower than Y Bottom Frame
: Set Plane Y co-ordinate to Y Bottom Frame

For best effect, place the hot spot of the plane at the bottom of the image. This will always keep it on screen by "sliding" it up if it gets left behind.

 
- Tigerworks
   

Post Reply



 



Advertisement

Worth A Click