The Daily Click ::. Forums ::. Klik Coding Help ::. Frames, scrolling, maps, and the camera
 

Post Reply  Post Oekaki 
 

Posted By Message

aphant



Registered
  18/05/2008
Points
  1242
16th August, 2008 at 10:37:40 -

In my platformer, I have this frame made up of a single room; The room is 4 screens by 2 screens (4*2). The camera moves around normally, collides with the edges of the frame normally. Moving out of the doors and onto the next frame/room transitions perfectly.

Let's say I took that same frame and area (4*2) but split it into two rooms, 3*2+1*1 and 1*1. Now I need my camera to be able to collide with artificial frame edges, so that the 1*1 room can't be seen until you get in there normally. How can I make the camera follow the player but also collide with artificial edges?

I'm also stumped on how to make a map screen (like the one Super Metroid has). I know the best option for keeping track of where you've been is to use a number array with a simple 0 or 1 to mark if you've been on that screen or not. I don't know what the most effective way would be to actually report that you've visited a screen or not. The only thing I've come up with (taking that 4*2 example for reference) would be to have 8 separate active objects and on overlap report that cell 1,1 or 3,2 or whatever was visited and destroy that active.

 

Introversity

Denture Disciple

Registered
  07/01/2007
Points
  42

Hero of TimeHas Donated, Thank You!
17th August, 2008 at 08:38:14 -

Get the screen to track your horizontal and vertical movement in separate events, and then add qualifiers such as If Player is halfway through the screen next to the Blocked Off Screen (or closer) then it stops tracking the Player (either horizontally or vertically).

Yeah, lots of ways to make a map object, but I can't think of any one simple way. You could always cheat and pull a Zelda, make collectable Maps ingame that you can look at; that's what I'd do.

 
Loves cute animals.

aphant



Registered
  18/05/2008
Points
  1242
17th August, 2008 at 14:48:24 -

Separate events makes sense. I tried using a camera object as big as the screen that stays with the player that was supposed to stop at the faux edges but it didn't work. Thanks for the suggestion, it got by brain churning.

 

Introversity

Denture Disciple

Registered
  07/01/2007
Points
  42

Hero of TimeHas Donated, Thank You!
18th August, 2008 at 15:14:51 -

Huh, I never thought it would be this difficult to do.

Just change your game so there's no places like that.

 
Loves cute animals.

aphant



Registered
  18/05/2008
Points
  1242
18th August, 2008 at 17:18:52 -

I very well could change my game so this wouldn't be an issue, but I like the idea of having large areas (30*15 is approximate size of the first area) separated into different rooms so that load times actually mean something and you're not loading a new map file everytime you change rooms. It'd make something like the elevators in Metroid actually worthwhile. And, I like the idea that the field of vision can be obstructed by things like really big pillars or being able to have irregularly shaped rooms (like an L).

 

Introversity

Denture Disciple

Registered
  07/01/2007
Points
  42

Hero of TimeHas Donated, Thank You!
19th August, 2008 at 09:09:11 -

The problem for me is if you're walking next to the wall of the place you can't see into and you go around a corner, the view snaps over to center around you again, and it looks really dodgy.

Best thing I can say to do is just cover the area you don't want people to see into with a black active object

 
Loves cute animals.

aphant



Registered
  18/05/2008
Points
  1242
24th August, 2008 at 07:19:13 -

I found a solution to the fake screen edges! After playing around with that screen-sized camera object, I decided that the best way is to just drop said object entirely. So what I did to replace it was have two events for horizontal and vertical scrolling, just as Introversity suggested. But, the real solution was making the camera movement around corners look good, which I achieved by simply rounding the edges. From here on it looks like it'll just be a matter of tweaking how much the corners should be rounded by, as well as shape.

Simplicity works!

 

Introversity

Denture Disciple

Registered
  07/01/2007
Points
  42

Hero of TimeHas Donated, Thank You!
24th August, 2008 at 15:00:19 -

You, sir, are brilliant.

 
Loves cute animals.
   

Post Reply



 



Advertisement

Worth A Click