MiniLD #28, hosted by LegacyCrono

Theme: War

Back to Browse Entries

The Epic Box War of Compulsive Minimalism

by Sos - Competition Entry

My aim was to create a game that can be embedded as an url (below 2048). I managed to create a 1122 byte swf, which then base64'd into 1538 bytes, but it appears browsers/flash player doesn't support base64'd embedded swf's, oh well....

PS. since I have around 500 bytes left, I'll improve!

EDIT:

I decided not to give up and created a custom PHP script to be able to embed my game in URL.
Now I can have bit.ly host my swf's :P

Downloads and Links


Ratings

#10Presentation3.27
#17Fun2.14
#17Coolness0%
#19Gameplay1.64

Comments

LegacyCrono says ...
Aug 1, 2011 @ 12:16pm

Pew pew! Bonus points for making it fit in an URL! :D

Folis says ...
Aug 1, 2011 @ 12:27pm

The game which was made to live as an URL!

Sos, you amaze me!

Also I loved the effects you could create with the beam!

jonbro says ...
Aug 1, 2011 @ 3:23pm

whoa dude! this is some amazing size coding! are you going to post the source at some point? I would love to see how you did it.

Sos says ...
Aug 1, 2011 @ 7:38pm

package
{
import flash.display.Sprite;
import flash.events.Event;
import flash.events.KeyboardEvent;

/**
* ...
* @author Sos
*/
public class M extends Sprite
{

public function M():void
{
if (stage) i();
else addEventListener(Event.ADDED_TO_STAGE, i);



}

private function i(e:Event = null):void
{
removeEventListener(Event.ADDED_TO_STAGE, init);
// entry point
stage.addEventListener (KeyboardEvent.KEY_DOWN, a);
stage.addEventListener (KeyboardEvent.KEY_UP, b);
addEventListener(Event.ENTER_FRAME, c);
stage.addChild(new B(0, 0, 320, 400, 0));

}
public function a (e:KeyboardEvent):void
{
/*
trace(
"Key code: " + e.keyCode + "\n" +
"Ctrl status: " + e.ctrlKey + "\n" +
"Key location: " + e.keyLocation + "\n" +
"Shift key: " + e.shiftKey + "\n");
*/
if (e.keyCode == 38) B.k |= 1;
if (e.keyCode == 40) B.k |= 2;
if (e.keyCode == 37) B.k |= 4;
if (e.keyCode == 39) B.k |= 8;
if (e.keyCode == 32) B.k |= 16;
//if (e.keyCode == 88) B.k |= 32;
}

public function b (e:KeyboardEvent):void
{
//trace("Key code: " + e.keyCode);

if (e.keyCode == 38) B.k &= ~1;
if (e.keyCode == 40) B.k &= ~2;
if (e.keyCode == 37) B.k &= ~4;
if (e.keyCode == 39) B.k &= ~8;
if (e.keyCode == 32) B.k &= ~16;

//B.k = 0;
//if (e.keyCode == 88) B.k &= ~32;
}

public function c(e:Event):void
{
if (Math.random() < .1) addChild(new B(1, 0, Math.random() * 640, 20));
//trace("update");
}
}

}

import flash.display.Shape;
import flash.events.Event;
import flash.geom.Point;

class B extends Shape
{
// bits:
// 0x|------||------||------||------|
// 0xvvxxxxxxvvyyyyyyllllllllwwwwmmtt
// mmtt -- mark and type
// wwll -- wparam (4bit) and lparam (8bit)
// vvxxvvyy -- velocity and position
//
// MARKS AND TYPES
// 00 - player
// * 00 - normal
// * 01 - powerupped
// * 10 - more powerupped
// * 11 - invurnelable
// 01 - enemy
// * 00 - normal
// * 01 - big
// * 10 - fast
// * 11 - boss
// 10 - bullet
// * 00 - player's
// * 01 - enemy's
// * 10 - player's big
// * 11 - enemy's big
// 11 - background
// * 00 - star
// * 01 - explosion particle
// * 10 - trail
// * 11 - ???
//
public static var k:uint = 0;
private var o:uint;
public function B(
t:uint, // type
m:uint, // mark
x:uint, // x
y:uint, // y
p:uint=0) // param
{
/*
this.graphics.lineStyle(1,0x800000);
if (t == 0)
{
this.graphics.lineStyle(3,0x00ff00);
this.graphics.beginFill(0x0000FF);
this.graphics.drawRect(0,0,10,10);
this.graphics.endFill();
} else if (t == 1){

this.graphics.beginFill(0xff0000);
this.graphics.drawRect(0,0,16,16);
this.graphics.endFill();

} else if (t == 2){
this.graphics.lineStyle(0,0x808000);
this.graphics.beginFill(0xffff00);
this.graphics.drawRect(0,0,2,5);
this.graphics.endFill();

}
*/
if ((o & 15) < 3)
{
this.graphics.lineStyle(t+1, t==1 ? r(0xffffff) :(0xff << t));
this.graphics.beginFill((0x80 << t));
this.graphics.drawRect(0, 0, t == 2 ? 3 : 16, t == 2 ? 3 : 16);
o = t;
} else if ((o & 15) == 3)
{
this.graphics.beginFill(r(0xffffff));
this.graphics.drawRect(0, 0, 3, 10);
o = (t & 0xf) | (m << 8) | (p << 16) | (0x40<<24);
}

this.x = x;
this.y = y;
addEventListener(Event.ENTER_FRAME,u);
}

public function g():void {
for (var c:uint = 0; c < 10; c++) parent.addChild(new B(3, r(0xff), x, y,r(0xff) ));
removeEventListener(Event.ENTER_FRAME, u);
parent.removeChild(this);
}
public static function r(i:uint):uint
{
return Math.random() * i;
}
public function u(e:Event):void
{
for each (var b:B in parent.getObjectsUnderPoint(new Point(x, y)))
{
if ((o&15)==2)
{
if (b.o == 1)
{
//b.removeEventListener(Event.ENTER_FRAME, update);
//parent.removeChild(b);
//return;
b.x = r(640);
b.y = -20;
}
} else if ((o&15) == 0)
{
if (b.o == 1)
{
x = 320;
y = 400;
}
}
}
if ((o&15) == 0)
{
if (k & 1) y-=5;
if (k & 2) y+=5;
if (k & 4) x-=5;
if (k & 8) x+=5;
if (k & 16) parent.addChild(new B (2, 0, x+5, y));
} else if ((o&15) == 1)
{
y += 1 + r(6);
x += 4 - r(8);
rotation += 15;
if (y > 480)
{
g();
//removeEventListener(Event.ENTER_FRAME, u);
//parent.removeChild(this);
}
} else if ((o&15)==2) {
y -= 12;
rotation += r(24);
if (y < 0)
{
g();
//removeEventListener(Event.ENTER_FRAME, u);
//parent.removeChild(this);
}
} else if ((o&15)==3) {
//y -= 12;
rotation += 24;
x += ((o >> 16) & 0xff) / 32.0;
y += ((o >> 8) & 0xff) / 32.0;
o |= (o & 0x00ffffff) | (((o >> 24)-1)<<24);
if (!(o&0xff000000))
{
g();
//removeEventListener(Event.ENTER_FRAME, u);
//parent.removeChild(this);
}
}

//trace("update");
}
}

tcstyle says ...
Aug 1, 2011 @ 7:46pm

Technically interesting. But as a game...
I like the minimalistic presentation.

TellusE says ...
Aug 1, 2011 @ 8:45pm

Sos, I realise now you're the type of person my mother warned me about.
You're batshit crazy! And it works! Excellent piece of tech :)

Nothing Games says ...
Aug 2, 2011 @ 12:37am

This is a really cool idea, i wouldn't of thought it possible :o

gimblll says ...
Aug 2, 2011 @ 5:49am

Cool tech trick/idea. Not much of a game though.

RandomM00 says ...
Aug 2, 2011 @ 1:53pm

I love the crazy idea, a game in a URL, but the game itself is as feature/graphics poor as I would expect :P

saluk says ...
Aug 5, 2011 @ 7:27pm

Mad props.

You must sign in to comment.


[cache: storing page]