posts dated from: june 2014

Quick Otter Camera Example

Quick Otter Camera Example
A question about the camera in Otter came up on the forums, and I whipped up a small example that could be useful to take a look at for getting started with Otter in general. The whole program is just this little chunk of code:

using Otter;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CameraTestThing {
class Program {
static void Main(string[] args) {

var game = new Game("Camera Test", 320, 180);
game.SetWindowScale(4);
game.Start(new TestScene());
}
}

class TestScene : Scene {

public TestScene() {
var grid = new Grid(1000, 1000, 20, 20, Color.Grey);
AddGraphic(grid);
Add(new Player());
}
}

class Player : Entity {

Vector2 speed = new Vector2();
Vector2 targetSpeed = new Vector2();
Vector2 maxSpeed = new Vector2(2, 2);
float accel = 0.01f;

Axis movementAxis = Axis.CreateArrowKeys();

public Player() {
SetGraphic(Image.CreateRectangle(10, Color.Red));
AddComponent(movementAxis);
}

public override void Update() {
base.Update();

targetSpeed.X = movementAxis.X * maxSpeed.X;
targetSpeed.Y = movementAxis.Y * maxSpeed.Y;

speed.X = Util.Approach(speed.X, targetSpeed.X, accel);
speed.Y = Util.Approach(speed.Y, targetSpeed.Y, accel);

X += speed.X;
Y += speed.Y;

Scene.CenterCamera(X, Y);
}
}
}

Compiling that with the latest dev version of Otter gives you a simple player object that can move around a scene. The background is a grid so that you can actually see scrolling happening. This quickly shows how to set up a movement Axis, how to apply speed to an object while getting input from the Axis, and how to center the camera on the object.

More Web Resources

More Web Resources
My break from game development ended up lasting a little bit longer than I expected, but I had a good vacation in the world of web design and development. Unfortunately the stuff I worked on is totally top secret, and will be for a little while still, but when it comes time to finally reveal it I'll be sure to post about it here.

There were a few more things that I learned or picked up that came in handy during this last project and I thought I would just share a few of them again.

Tumblr Custom Theme Documentation
This lastest web project involved using tumblr as the content management system. I haven't done any work with tumblr before, but it turned out to be pretty straight forward and overall really easy to work with. Unlike Wordpress I never have to even venture into php territory. Tumblr seems to use some kind of built in templating system that takes care of everything behind the scenes. The official documentation on how to build a tumblr theme actually ended up being the best resource for getting started on it. A lot of the other tutorials I found on theme building were already outdated, so I just stuck to using control-f on the documentation whenever I needed to know something.

Tumblr Boilerplate
This is a quick and simple tumblr theme that implements all of the essential tags. This was a great place to get started and see how the various tags work along side some HTML and CSS. There was one guide that recommended starting with this, and I used it as a guide when I was starting on a custom theme.

Open Graph Protocol
If you want posts to be shared around properly on Facebook then having open graph meta tags in your HTML is essential. You're able to define things like the preview image, description, and title of your articles, which can be very important for when your awesome web page finally goes viral with all the kids. Facebook and other social media things can parse some things from your site automatically, but sometimes the layout of your site will cause it to parse the wrong things so these tags are a way to overcome that.

Social Media Templates
Related to the Open Graph tags, here are templates that cover the rest of the core social media tags. The meta tags for Twitter and even Google+ are available here to copy and paste into your web zone. Once again just useful for controlling what info shows up when people share your site across various social media sites.

Tumblr Static File Upload
When working with a custom tumblr theme you have two main options when it comes to hosting resources. You can either host them all remotely on a separate web server, or you can just upload all of the files to tumblr and have them worry about it. I found that my work flow was best when using a remote server for awhile, and then when things were more concrete I migrated over to the tumblr server. Using the tumblr static file upload you can host all of your files directly on tumblr, but it comes more of a pain to modify and reupload files (like css, font files, images, etc.) Ultimately I think using tumblr's servers for the final product is the best bet.

Firefox Cross Domain Font Fix
This one is pretty technical, but is super important when it comes to using the @font-face properties in CSS with a custom tumblr theme. Firefox cannot load fonts across domains without explicit permission from the host domain. Since the tumblr servers do not have this permission properly implemented, any custom fonts you try to load with the @font-face property will just not load on Firefox. Apparently this is the correct behavior, but kind of annoying since Chrome doesn't seem to care at all where fonts come from. The fix is simple enough though. By encoding fonts as base64 data directly into the style sheet Firefox is able to load the font no problem.

I think that's all for now! Hopefully today I can dig back into game development work, but I had a lot of fun brushing up on the latest web development action.

Doodle Post

Image

Doodle Post

Image

Offspring Fling Summer Sale

Offspring Fling Summer Sale
It's that time again! Offspring Fling is now available for 50% off on Steam for the duration of the Steam Summer Sale. It's hard to believe this game came out two years ago now. It feels like only yesterday I was working 14 hour days to get the game and the level sharing website ready for the Steam launch.

At some point soon I do want to have a proper postmortem post with all kinds of stats but I first need to make sure I'm able to post those stats without getting in trouble.

Side Trip to Web Design Land

Side Trip to Web Design Land
Things have been pretty quiet around here for a couple of days! I'm still working on video games, but recently I decided to take up some (hopefully) quick web design work! Although I can't share the details of what I'm working on, I can share some resources that came in handy for prepping me for the new world of web design.

My work flow for sites is terribly outdated in the modern world where 55% of web traffic apparently comes from mobile devices. Then on top of that, some desktops are now reaching resolutions of 2000+ horizontal pixels with retina displays and just plain ole huge monitors. The web is always changing, and it has changed a lot since I've really buckled down for a design project.

Responsive design is all the rage now, and my old work flow of mocking up an entire website in Photoshop, slicing it up into separate images, and reassembling it so it's pixel perfect just no longer applies to how modern sites are built. Now sites are built using responsive designs. The layout is determined by the resolution and the device that the site is being viewed on. So here are some helpful links that got me up to speed with all this newfangled HTML and CSS and Javascript and what have you:

Web Field Manual
This is a link to a collection of more links! A lot of the stuff here was pretty useful for getting set up with a new work flow, and to catch up on recent trends in web design. Separated by category, I think I looked through almost every link they offered.

Flat Icon
About a billion of free to use icons (as long as you attribute the source) for any sort of design needs.

Responsive Workflow
A good article discussing the changes in the web development work flow from back in the old days of PSD mock ups to the new way of prototyping directly in HTML, CSS, and Javascript.

HTML5 Templates
Useful for taking a look at various styles that are designed with responsiveness in mind. See how various templates respond to various mobile device resolutions.

Responsive Grid System
A pretty nifty responsive grid framework to use when developing a responsive site.

Unsemantic
Another nifty grid system for responsive design. I used this for the Otter website.

Font Squirrel
This is blowing my mind but apparently fonts can just be straight up embedded now in modern browsers. No more need for crazy flash javascript canvas hacks to render text of any font.

Unsplash
A collection of high resolution totally free to use stock photos, and it's updated frequently.

Web Creme
Pretty straight forward inspiration gallery of recent cool and/or hip websites. Some of these are a little bit too trendy but there's a lot of good stuff here to check out.