This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import os, sys | |
from xml.dom import minidom | |
#-------------------------------------- | |
BASE_PATH = os.path.dirname(__file__) | |
MAP_SRC_DIR = os.path.join(BASE_PATH, 'data/maps') | |
MAP_COMPILED_DIR = os.path.join(BASE_PATH, 'data/maps/compiled') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package | |
{ | |
import flash.desktop.NativeApplication; | |
import flash.events.Event; | |
import flash.events.NativeWindowBoundsEvent; | |
import net.flashpunk.Engine; | |
import net.flashpunk.FP; | |
import net.flashpunk.Screen; | |
/** | |
* ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Screen.as PATCH Richard Marks <[email protected]> - Jan 07, 2011 | |
/** | |
* resizes the screen - updates FP dimension variables | |
* you should not do this a lot, there will be lag. | |
* @param width new width of the screen | |
* @param height new height of the screen | |
*/ | |
public function resize(width:uint, height:uint):void | |
{ | |
// tell FP the screen size has changed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; hello.ecpua | |
inc 0x0A | |
print ; newline | |
inc 0x3E | |
print ; H | |
inc 0x1D | |
print ; e | |
inc 0x07 | |
print ; l | |
print ; l |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add to MapEntity.as - this is not the full MapEntity.as file. | |
/** | |
* checks if there is a warp that collides with the specified entity | |
* @param e - the entity to test collision against | |
* @return null if no warp is found, and the WarpPoint object if there is one | |
*/ | |
public function CheckWarpCollidesWith(e:Entity):WarpPoint | |
{ | |
// loop through each warp in the warps container |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// sprites.png is 640x240 with the left 320x240 holding player sprite frames | |
// and the right 320x240 holding the enemy frames | |
[Embed(source="../assets/sprites.png")] private const SPRITES_PNG:Class; | |
var sprites:BitmapData = (new SPRITES_PNG).bitmapData; | |
var playerSprites:BitmapData = new BitmapData(320, 240); | |
var enemySprites:BitmapData = new BitmapData(320, 240); | |
playerSprites.copyPixels(sprites, new Rectangle(0,0, 320, 240), new Point); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private function CreateMinimap():void | |
{ | |
// create a buffer the same size as your game world | |
// fill it with nothing (0% alpha and no pixels drawn on it) | |
minimapDisplay = new BitmapData(WORLD_WIDTH, WORLD_HEIGHT, true, 0x00000000); | |
// loop over the game world exploration grid | |
var gh:Number = Global.exploredMap.rows; | |
var gw:Number = Global.exploredMap.columns; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package | |
{ | |
import flash.display.*; | |
import flash.events.*; | |
import flash.net.*; | |
import flash.system.*; | |
/** | |
* kongregate API | |
* @author Richard Marks | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.flashpunk.utils | |
{ | |
import net.flashpunk.graphics.Spritemap; | |
/** | |
* Utility class for loading sprite definitions from an XML file | |
* | |
* A Sprite Definition XML Document containing two sprite definitions is shown below: | |
* | |
* <sprites> | |
* <sprite name="player" width="32" height="32"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
RoomPather.java | |
By: Kevin Hulin | |
Upon reading the challenge problem, I immediately thought of a math problem | |
that I had read an article about. The NP-C salesman problem, or "Given | |
a set of houses to visit, give the shortest path that touches each | |
house only once." This idea being set in my head and a little more research | |
on the problem led me to design a program that takes a set of coordinates | |
and returns an "almost shortest" path that touches each point exactly once. |
OlderNewer