@LyleCox Darn. I guess the GC might be the culprit then. (Today)

SFML C#'s framerate seems a little.. jittery? Like it's hitching every so often... or I'm just going insane. (Today)

@DiscordGames Oh snap I might do that sometime! <3 (Today)

@infinite_ammo Oh bo :( (Today)

@infinite_ammo 64 GIGS OF RAM DO IT (Today)

One time I put "10" instead of "10f" for a float and I almost died. (Today)

RT @infinite_ammo: Check out some music I'm working on for Crypt of the NecroDancer :) t.co/Gn7G9HbQSE (Today)

RT @MattThorson: Streamin' some TowerFall level design once again t.co/x0cSmmrKOX (Today)

My website gets a lot of traffic from Russian sites saying that Offspring Fling is a pikachu adventure game. (Today)

@TommyRefenes @JasonBrouwers @ChevyRay Yeah I would use a shader. (Today)

@JasonBrouwers @TommyRefenes @ChevyRay Hahah yeah it's pretty insane. I just want some of the ancient features like animated palettes... (Today)

@aeiowu NICE Cosmic dream cocoa is probably the best you can get. (Today)

@TommyRefenes @ChevyRay I want to make SNES games, Tommy. You know what I did when I got into wario world? Tried to order an SNES kit. (Today)

@BenKuchera You could disguise yourself and attend as Ken Buchera. (Today)

@EvanBalster @ChevyRay Shaders are pretty hard to do though. :( I wish I could just assign a palette to a bitmap and have it work haha (Today)

@aeiowu Hey I had a dream you were shoveling all the snow in front of my Aunt's house, so thanks for doing that. (Today)

@ADAMATOMIC Yo that guy will eat your sweater in one bite, be careful. (Today)

@ChevyRay Oh right and I think there are many more things that Ogmo Editor could do to make it way better. (Today)

@ChevyRay I wish palette shifting for 2d pixel art was easier to do, like those old school waterfalls that just cycled colors... <3 (Today)

RT @ChevyRay: For those of you interested in a "unity2d", keep your eye on @Polycode! (Today)

follow
search

2013 - 3 - 4 / 3:26 pm / games

Dev Log: Some More Camera Stuff

Dev Log: Some More Camera Stuff

I'm feeling pretty exhausted today so this post will probably be pretty short. Last week I posted about working on some camera stuff for platforming in Flashpunk. I made a few adjustments to the way my camera worked based on some more stuff I observed from Mario World and Yoshi's Island.

Image
I changed around how some of the horizontal camera stuff works. Now you have some wiggle room before the camera starts to move at all horizontally. The look ahead also works slightly better than before. If you're pushing up against the side of the wiggle-area, the camera will slowly look ahead in the direction you're pushing. If you're moving in that direction, the speed in which it looks ahead increases so that you'll hopefully always be able to see what's coming down the line if you're moving fast.

The vertical movement is more or less the same. The camera only catches up to you when you're on a platform, or if you're pushing the margin of the screen with jumping or falling. The falling margin of the screen is much higher, since usually if you're falling you want to see a little bit downward. One thing I did change was the camera's natural target point in the y direction. Now if the camera thinks you're moving upward a lot, it will look above the player somewhat. If you're moving down though, it will look directly at the player again. Looking somewhat above the player ends up looking nice in most platformers because locking on in the center usually means showing 50% of the screen as solid ground with the most basic camera behavior.

I have run into some snags along the way... right now I need to figure out how to handle camera blocking better. Camera blockers are necessary for a game like this to hide secret areas, and I don't want to reveal them until the player actually crosses into the secret area. At the point in which the player crosses the blocker, the camera will then be unlocked and catch up to its target position again. This worked fine up until the point in which I made the player camera more complicated... I might have to do some tinkering to get it working just the way I want, but also in a clean and reusable way.

Okay that's all for now! (PS The Flashpunk website is still down, but once it comes back up all my links to it will work again! Also if you're looking for just the code, check out the Git repository.)

3 Comments
Avatar

2013 - 3 - 4 8:03 PM

Nounverber

This may come to late but I found this video to be interesting/helpful.
http://www.youtube.com/watch?v=TCIMPYM0AQg

You may also want to consider spelunky-like camera controls, where you can move the camera up/down by holding the respective arrow keys (as long as you don't use them for other controls).

Avatar

2013 - 3 - 5 2:13 PM

Kyle

I actually posted that video in my previous blog post, and based a lot of this on the Mario World and Yoshi's Island camera! :)

Up and down looking controls are currently working, but I need to fix some issues with the camera pushing past camera boundaries when looking up and down.

Avatar

2013 - 3 - 9 12:02 AM

Yuan Hao

Camera looks really nice -- I happened to be working on our own camera at the same time and took some inspiration from yours :)

One question, since it's hard to see it in the GIF because of the framerate, do you ever move less than one pixel per frame? For example, one pixel every two or three frames? I ended up doing that to make the camera feel smoothly, but I'm not sure if I'm happy with it.

Cheers~!

Avatar

Post your comment!

POST COMMENT

about

About

Hi there, my name is Kyle, and I'm a 27 year old kid with adult powers. I'm making video games and living the indie game developer life in Tempe, Arizona. Here you will find my thoughts, games, websites, doodles, and other stuff like that. I worked on Snapshot, Offspring Fling, and a whole bunch of other games. If you want to get a hold of me use the form on the bottom of the page, leave a comment, or just tweet at me. I try to post three times a week. Thanks for stoppin' by!

facebook

old sites

xerus kylepulver

contact

Your message has been sent! Thanks :)
SEND MESSAGE