This is my first go at setting up a reusable camera class so it may need a bit of tweaking when used in a real situation.
Setup a camera, giving it x,y, render window width and height, zoom, a maximum zoom value, and constraints. The camera will then keep the bitmap edges within the render window frame regardless of the zoom (it works out the furthest you can zoom out based on the constraints you give it, but you can make you maximum zoom whatever you like.
This camera class needs to work with a rendering system to support it, which I have in the main class.
I have used my ‘landscape generator‘ code to make the map for this, but it’s very easlily adapted to using a library bitmap.
A top down terrain / landscape generator using perlinNoise and paletteMap to create the effect. The gradient that applies the colours can easily be adjusted.
CLICK TO GENERATE NEW IMAGES.
var MENU_ITEM_0:String=”www.terrypaton.com”;
var MENU_ITEM_1:String=”Made by Terry!”;
var MENU_ITEM_2:String=”LOW Quality”;
var MENU_ITEM_3:String=”HIGH Quality”;
var myContextMenu:ContextMenu;
myContextMenu = new ContextMenu();
addCustomMenuItems ();
function addCustomMenuItems ():void {
myContextMenu.hideBuiltInItems ();
var defaultItems:ContextMenuBuiltInItems=myContextMenu.builtInItems;
defaultItems.print = false;
var item0:ContextMenuItem=new ContextMenuItem(MENU_ITEM_0);
myContextMenu.customItems.push (item0);
var item1:ContextMenuItem=new ContextMenuItem(MENU_ITEM_1);
myContextMenu.customItems.push (item1);
var item2:ContextMenuItem=new ContextMenuItem(MENU_ITEM_2);
myContextMenu.customItems.push (item2);
var item3:ContextMenuItem=new ContextMenuItem(MENU_ITEM_3);
myContextMenu.customItems.push (item3);
Here’s a simple but effective technique to disolve between images using the bitmapData threshold command. I’ve setup a class that’ll make it easy to apply, but this is really just the start and can be extended and developed quite a bit!
Here’s a small class that I setup to draw a ‘landscape’, well a bunch of wiggly lines at least with a little blurring. Pass a bitmapData and it will draw to it. This could be modified top accept colour parameters and a few other things to make it snazzy.
este juego es bkn
this is not great its horrible
My wins are not being recorded. The screen goes right to play.
So Billy, did you forget to post your score? I can finish in less than ten minutes if I play blind!
I’m going to China,Billy!!You’re going to DIE!!!
Recent Comments
este juego es bkn this is not great its horrible My wins are not being recorded. The screen goes right to play. So Billy, did you forget to post your score? I can finish in less than ten minutes if I play blind! I’m going to China,Billy!!You’re going to DIE!!!