Hello WWWWWWorld!

This commit is contained in:
Ethan Lee
2020-01-01 15:29:24 -05:00
commit f7c0321b71
133 changed files with 154973 additions and 0 deletions

View File

@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<application xmlns="http://ns.adobe.com/air/application/25.0">
<id>com.distractionware.vvvvvvmobile</id>
<versionNumber>1.02</versionNumber>
<supportedProfiles>mobileDevice</supportedProfiles>
<filename>VVVVVV</filename>
<name>VVVVVV</name>
<android>
<manifestAdditions><![CDATA[<manifest android:installLocation="auto">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-feature android:required="true" android:name="android.hardware.touchscreen.multitouch" />
</manifest>]]></manifestAdditions>
</android>
<iPhone>
<InfoAdditions><![CDATA[<key>UIStatusBarStyle</key>
<string>UIStatusBarStyleBlackOpaque</string>
<key>UIRequiresPersistentWiFi</key>
<string>NO</string>
<key>UIPrerenderedIcon</key>
<true />
<key>UIApplicationExitsOnSuspend</key>
<false />
<key>UIDeviceFamily</key>
<array>
<!-- iPhone support -->
<string>1</string>
<!-- iPad support -->
<string>2</string>
</array>]]></InfoAdditions>
<requestedDisplayResolution>standard</requestedDisplayResolution>
</iPhone>
<initialWindow>
<title>VVVVVV</title>
<content>vvvvvv.swf</content>
<visible>true</visible>
<aspectRatio>landscape</aspectRatio>
<renderMode>gpu</renderMode>
<systemChrome>standard</systemChrome>
<autoOrients>true</autoOrients>
<fullScreen>true</fullScreen>
</initialWindow>
<icon>
<image48x48>icons/icon_48.png</image48x48>
<image57x57>icons/icon_57.png</image57x57>
<image72x72>icons/icon_72.png</image72x72>
<image76x76>icons/icon_76.png</image76x76>
<image96x96>icons/icon_96.png</image96x96>
<image114x114>icons/icon_114.png</image114x114>
<image120x120>icons/icon_120.png</image120x120>
<image144x144>icons/icon_144.png</image144x144>
<image152x152>icons/icon_152.png</image152x152>
<image512x512>icons/icon_512.png</image512x512>
<image1024x1024>icons/icon_1024.png</image1024x1024>
</icon>
<!--
AIR options:
http://livedocs.adobe.com/flex/3/html/File_formats_1.html#1043413
AIR mobile options:
http://help.adobe.com/en_US/air/build/WSfffb011ac560372f-5d0f4f25128cc9cd0cb-7ffe.html
Android manifest documentation:
http://developer.android.com/guide/topics/manifest/manifest-intro.html
-->
<extensions>
<extensionID>com.milkmangames.extensions.GameCenter</extensionID>
<!--
<extensionID>com.sticksports.nativeExtensions.SilentSwitch</extensionID>
<extensionID>com.mesmotronic.ane.fullscreen</extensionID>
-->
</extensions>
</application>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,75 @@
package {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.net.*;
public class newgameclass {
public function newgameclass():void {
tmap.reset();
}
public function changemapsize(xw:int, yh:int):void {
mapwidth = xw; mapheight = yh;
}
public function loadlevel(t:String, obj:entityclass, music:musicclass):void {
if(t=="newgame_enter"){
changemapsize(40,30);
tmap.push("2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2");
tmap.push("2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2");
tmap.push("2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2");
tmap.push("2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2");
tmap.push("2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2");
tmap.push("2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2");
tmap.push("2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2");
tmap.push("2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2");
tmap.push("2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2");
tmap.push("2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2");
tmap.push("2,2,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2");
tmap.push("2,2,2,2,2,2,2,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2");
tmap.push("2,2,2,2,2,2,2,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,2,2");
tmap.push("2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,2,2");
tmap.push("2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,2,2");
tmap.push("2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,2,2");
tmap.push("2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,2,2");
tmap.push("2,2,2,2,2,2,2,1,2,1,2,1,1,2,1,1,2,1,1,1,2,1,1,2,1,2,1,2,2,2,2,1,1,1,1,1,2,2,2,2");
tmap.push("2,2,2,2,2,2,2,2,2,2,1,1,1,2,2,1,2,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2");
tmap.push("2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2");
tmap.push("2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2");
tmap.push("2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2");
tmap.push("2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2");
tmap.push("2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2");
tmap.push("2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2");
tmap.push("2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2");
tmap.push("2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2");
tmap.push("2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2");
tmap.push("2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2");
tmap.push("2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2");
obj.createdoor(8, 12, "newgame_room2", 4, 10);
}else if(t=="newgame_room2"){
changemapsize(20,15);
tmap.push("2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2");
tmap.push("2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2");
tmap.push("2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2");
tmap.push("2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2");
tmap.push("2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2");
tmap.push("2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2");
tmap.push("2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2");
tmap.push("2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2");
tmap.push("2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2");
tmap.push("2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2");
tmap.push("2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2");
tmap.push("2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2");
tmap.push("2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2");
tmap.push("2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2");
tmap.push("2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2");
obj.createdoor(16, 12, "newgame_enter", 7, 22);
}
}
public var mapwidth:int, mapheight:int;
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

5
mobile_version/readme.MD Normal file
View File

@@ -0,0 +1,5 @@
This is the source code for the adobe air mobile version of VVVVVV, which is forked from the original flash source code.
The mobile version needs a different data.zip folder, which [can be downloaded from here](https://thelettervsixtim.es/opensource/vvvvvv%20mobile%20data%20folder.zip). Just like the asset contents from the C++ version, the contents of this folder are still under a proprietary license.
Requires Adobe AIR, targeting SWF version 36.

View File

@@ -0,0 +1,28 @@
package {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.net.*;
public class EditorDataclass{
public function EditorDataclass():void {
clear();
}
public function clear():void {
numedentities = 0;
title = "";
creator = "";
modifier = "";
timeCreated = "";
timeModified = "";
}
public var numedentities:int;
public var title:String;
public var creator:String;
public var modifier:String;
public var timeCreated:String;
public var timeModified:String;
}
};

View File

@@ -0,0 +1,42 @@
package {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.net.*;
public class LevelMetaData{
public function LevelMetaData():void {
clear();
}
public function clear():void {
title = "";
creator = "";
Desc1 = "";
Desc2 = "";
Desc3 = "";
website = "";
filename = "";
file_num = 0;
modifier = "";
timeCreated = "";
timeModified = "";
version = 0;
}
public var title:String;
public var creator:String;
public var Desc1:String;
public var Desc2:String;
public var Desc3:String;
public var website:String;
public var filename:String;
public var file_num:int;
public var modifier:String;
public var timeCreated:String;
public var timeModified:String;
public var version:int;
}
};

1036
mobile_version/src/Main.as Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,310 @@
//Big thanks to Muku for his help with working out how to do a preloader in FlashDevelop!
package {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.net.*;
import flash.utils.getDefinitionByName;
import flash.system.fscommand;
import flash.ui.ContextMenu;
import flash.ui.ContextMenuItem;
//import com.kongregate.as3.client.KongregateAPI;
//Mochi and Kongregate stuff is more or less ready here
public dynamic class Preloader extends MovieClip {
public function Preloader() {
fscommand("trapallkeys", "true");
if (stage.root.loaderInfo.url.search(/.swf$/) >= 0) {
//fscommand("showmenu", "false");
}
stage.showDefaultContextMenu = (stage.root.loaderInfo.url.search(/.swf$/) >= 0);
//For the offline version, manually change this
if (checksite()) {
adson = false;
}else{
adson = true;
}
adson = false;
//Let's assume the kong API is clever enough to do its own checking
//var kongregate:KongregateAPI = new KongregateAPI();
//this.addChild ( kongregate );
//stage.showDefaultContextMenu = false;
//show c64 intro (30, 0), set to (-10, 100) to not show
//transition = -10; fakepercent = 100;
transition = 30; fakepercent = 0;
var rc_menu:ContextMenu = new ContextMenu();
rc_menu.hideBuiltInItems();
this.contextMenu = rc_menu;
ct = new ColorTransform(0, 0, 0, 1, 255, 255, 255, 1); //Set to white
darkcol = 0x000000; lightcol = 0x000000; curcol = 0;
offset = 0; coltimer = 0;
frontrect = new Rectangle(30, 20, 260, 200);
temprect = new Rectangle(0, 0, 320, 24);
tl = new Point(0, 0);
tpoint = new Point(0, 0);
bfont_rect=new Rectangle(0,0,8,8);
var tempbmp:Bitmap;
tempbmp = new im_bfont(); buffer = tempbmp.bitmapData;
makebfont();
backbuffer=new BitmapData(320, 240,false,0x000000);
screenbuffer = new BitmapData(320, 240, false, 0x000000);
screen = new Bitmap(screenbuffer);
screen.width = 640;//320;//;640;
screen.height = 480;// 240;//480;
addChild(screen);
addEventListener(Event.ENTER_FRAME, checkFrame);
if (!adson) {
/*
loading = new im_loading();
loading.x = 320 - (loading.width / 2);
loading.y = 316;
addChild(loading);
*/
}
showctp = false;
startgame = false;
}
public function visit_distractionware(e:Event):void{
var distractionware_link:URLRequest = new URLRequest( "http://www.distractionware.com" );
navigateToURL( distractionware_link, "_blank" );
}
public function visit_sponsor(e:Event):void{
var sponsor_link:URLRequest = new URLRequest( "http://www.kongregate.com/?gamereferral=dontlookback" );
navigateToURL( sponsor_link, "_blank" );
}
public function print(x:int, y:int, t:String, r:int, g:int, b:int, cen:Boolean = false):void {
if (r < 0) r = 0; if (g < 0) g = 0; if (b < 0) b = 0;
if (r > 255) r = 255; if (g > 255) g = 255; if (b > 255) b = 255;
ct.color = RGB(r, g, b);
if (cen) x = x - (len(t));
bfontpos = 0;
for (var i:int = 0; i < t.length; i++) {
cur = t.charCodeAt(i);
tpoint.x = x + bfontpos; tpoint.y = y;
bfont[cur].colorTransform(bfont_rect, ct);
backbuffer.copyPixels(bfont[cur], bfont_rect, tpoint);
bfontpos+=bfontlen[cur];
}
}
public function checkFrame(e:Event):void {
var p:Number = this.loaderInfo.bytesLoaded / this.loaderInfo.bytesTotal;
//if (stage.root.loaderInfo.url.search(/.swf$/) >= 0) p = 0; //Not for the demo!
transition = -10; fakepercent = 100;
if (transition < 30) transition--;
if(transition>=30){
if (int(p * 100) >= fakepercent) fakepercent++;
if (fakepercent >= 100) {
fakepercent = 100;
startgame = true;
}
offset = (offset + 4 + int(Math.random()*5))%32;
coltimer--;
if (coltimer <= 0) {
curcol = (curcol + int(Math.random() * 5)) % 6;
coltimer = 8;
}
switch(curcol) {
case 0:
lightcol = 0xBF596F;
darkcol = 0x883E53;
break;
case 1:
lightcol = 0x6CBC5C;
darkcol = 0x508640;
break;
case 2:
lightcol = 0x5D57AA;
darkcol = 0x2F2F6C;
break;
case 3:
lightcol = 0xB7BA5E;
darkcol = 0x848342;
break;
case 4:
lightcol = 0x5790AA;
darkcol = 0x2F5B6C;
break;
case 5:
lightcol = 0x9061B1;
darkcol = 0x583D71;
break;
}
for (var i:int = 0; i < 18; i++) {
temprect.y = (i * 16) -offset;
if (i % 2 == 0) {
backbuffer.fillRect(temprect, lightcol);
}else{
backbuffer.fillRect(temprect, darkcol);
}
}
backbuffer.fillRect(frontrect, 0x3E31A2);
tempstring = "LOADING... " + String(int(fakepercent))+"%";
print(282, 204, tempstring, 124, 112, 218, true);
//Render
screenbuffer.lock();
screenbuffer.copyPixels(backbuffer, backbuffer.rect, tl, null, null, false);
screenbuffer.unlock();
backbuffer.lock();
backbuffer.fillRect(backbuffer.rect, 0x000000);
backbuffer.unlock();
if (currentFrame >= totalFrames){
if (startgame) {
transition = 29;
}
}
}else if (transition <= -10) {
if (currentFrame >= totalFrames){
startup();
}
}else if (transition < 5) {
backbuffer.fillRect(backbuffer.rect, 0x000000);
//Render
screenbuffer.lock();
screenbuffer.copyPixels(backbuffer, backbuffer.rect, tl, null, null, false);
screenbuffer.unlock();
backbuffer.lock();
backbuffer.fillRect(backbuffer.rect, 0x000000);
backbuffer.unlock();
}else if (transition < 20) {
temprect.y = 0;
temprect.height = 240;
backbuffer.fillRect(temprect, 0x000000);
backbuffer.fillRect(frontrect, 0x3E31A2);
tempstring = "LOADING... 100%";
print(282, 204, tempstring, 124, 112, 218, true);
//Render
screenbuffer.lock();
screenbuffer.copyPixels(backbuffer, backbuffer.rect, tl, null, null, false);
screenbuffer.unlock();
backbuffer.lock();
backbuffer.fillRect(backbuffer.rect, 0x000000);
backbuffer.unlock();
}
}
private function startup():void {
// hide loader
//stop();
removeChild(screen);
removeEventListener(Event.ENTER_FRAME, checkFrame);
//loaderInfo.removeEventListener(ProgressEvent.PROGRESS, progress);
var mainClass:Class = getDefinitionByName("Main") as Class;
addChild(new mainClass() as DisplayObject);
//stage.removeChild(this);
}
public function checksite():Boolean {
//Returns true if on a site that doesn't use mochiads
var currUrl:String = stage.loaderInfo.url.toLowerCase();
//chat.kongregate.com
if ((currUrl.indexOf("distractionware.com") <= 0) &&
(currUrl.indexOf("flashgamelicense.com") <= 0) &&
(currUrl.indexOf("kongregate.com") <= 0) &&
(currUrl.indexOf("chat.kongregate.com") <= 0)){
//return true;
return false;
}else{
return true;
}
}
public function len(t:String):int {
bfontpos = 0;
for (var i:int = 0; i < t.length; i++) {
cur = t.charCodeAt(i);
bfontpos+=bfontlen[cur];
}
return bfontpos;
}
public function RGB(red:Number,green:Number,blue:Number):Number{
return (blue | (green << 8) | (red << 16))
}
public function makebfont():void {
for (var j:Number = 0; j < 16; j++) {
for (var i:Number = 0; i < 16; i++) {
var t:BitmapData = new BitmapData(8, 8, true, 0x000000);
var t2emprect:Rectangle = new Rectangle(i * 8, j * 8, 8, 8);
t.copyPixels(buffer, t2emprect, tl);
bfont.push(t);
}
}
//Ok, now we work out the lengths (this data string cortesy of a program I wrote!)
for (i = 0; i < 256; i++) bfontlen.push(6);
var maprow:Array;
var tstring:String="4,3,5,7,6,7,6,3,4,4,7,7,3,5,2,5,6,5,6,6,6,6,6,6,6,6,2,3,5,5,5,6,7,6,6,6,6,5,5,6,6,3,6,6,5,7,7,6,6,6,6,6,5,6,7,7,7,7,5,4,5,4,5,6,4,6,6,6,6,5,5,6,6,3,6,6,5,7,7,6,6,6,6,6,5,6,7,7,7,7,5,5,3,5,6,4";
maprow = new Array();
maprow = tstring.split(",");
for(var k:int = 0; k < 96; k++) {
bfontlen[k + 32] = 8;// int(maprow[k]);
}
}
public var darkcol:int, lightcol:int, curcol:int, coltimer:int;
public var offset:int;
public var buffer:BitmapData;
public var backbuffer:BitmapData;
public var screenbuffer:BitmapData;
public var screen:Bitmap;
public var frontrect:Rectangle;
public var temprect:Rectangle;
public var showctp:Boolean;
public var startgame:Boolean;
public var adson:Boolean;
[Embed(source = '../data/graphics/font.png')] private var im_bfont:Class;
public var bfontlen:Array = new Array();
public var bfont:Array = new Array();
public var bfont_rect:Rectangle;
public var tl:Point, tpoint:Point;
public var bfontpos:int;
public var cur:int;
public var ct:ColorTransform;
public var tempstring:String;
public var fakepercent:int;
public var transition:int;
public var statcookie:SharedObject;
}
}

View File

@@ -0,0 +1,371 @@
/**
* Key polling class
*
* To create:
* var key:KeyPoll = new KeyPoll( displayObject );
*
* the display object will usually be the stage.
*
* Full example:
* package
* {
* import flash.display.Sprite;
* import flash.events.Event;
* import flash.ui.Keyboard;
* import fgc.input.KeyPoll;
*
* public class Test
* {
* var key:KeyPoll;
*
* public function Test()
* {
* key = new KeyPoll( this.stage );
* addEventListener( Event.ENTER_FRAME, enterFrame );
* }
*
* public function enterFrame( ev:Event ):void
* {
* if( key.isDown( Keyboard.LEFT ) )
* {
* trace( "left key is down" );
* }
* if( key.isDown( Keyboard.RIGHT ) )
* {
* trace( "right key is down" );
* }
* }
* }
* }
*
* Author: Richard Lord
* Copyright (c) FlashGameCode.net 2007
* Version 1.0.2
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package bigroom.input
{
import flash.events.KeyboardEvent;
import flash.events.Event;
import flash.display.DisplayObject;
import flash.utils.ByteArray;
import flash.events.TouchEvent;
import flash.ui.Multitouch;
import flash.ui.MultitouchInputMode;
import flash.ui.*;
import flash.events.MouseEvent;
import flash.net.*;
public class KeyPoll
{
private var states:ByteArray;
private var dispObj:DisplayObject;
public var click:Boolean = false;
public var clickheld:Boolean = false;
public var hasclicked:Boolean = false;
public var press:Boolean = false;
public var onscreen:Boolean=true;
public var gotosite:String = "";
public var touchx:Vector.<int> = new Vector.<int>;
public var touchy:Vector.<int> = new Vector.<int>;
public var touchid:Vector.<int> = new Vector.<int>;
public var temptouchid:int = 0;
public var controlstick:int = -1;
public var controlstick_x:int = 0;
public var controlstick_y:int = 0;
public var pushleft:Boolean = false;
public var pushright:Boolean = false;
public var controlstick_xrange:int = 0;
public var controlstick_yrange:int = 0;
public var deadzone:int = 0, deadzone_inner:int = 0;
public var firstmove:Boolean = false;
public var touchPoints : uint;
public function KeyPoll( obj:DisplayObject )
{
states = new ByteArray();
states.writeUnsignedInt( 0 );
states.writeUnsignedInt( 0 );
states.writeUnsignedInt( 0 );
states.writeUnsignedInt( 0 );
states.writeUnsignedInt( 0 );
states.writeUnsignedInt( 0 );
states.writeUnsignedInt( 0 );
states.writeUnsignedInt( 0 );
touchPoints = 0;
for (var i:int = 0; i < 20; i++) {
touchx.push(0);
touchy.push(0);
touchid.push(-1);
}
Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;
dispObj = obj;
dispObj.addEventListener( KeyboardEvent.KEY_DOWN, keyDownListener, false, 0, true );
dispObj.addEventListener( KeyboardEvent.KEY_UP, keyUpListener, false, 0, true );
dispObj.addEventListener( Event.ACTIVATE, activateListener, false, 0, true );
dispObj.addEventListener( Event.DEACTIVATE, deactivateListener, false, 0, true );
/*
dispObj.addEventListener( MouseEvent.MOUSE_DOWN, mouseDownListener);
dispObj.addEventListener( MouseEvent.MOUSE_UP, mouseUpListener );
*/
dispObj.addEventListener( TouchEvent.TOUCH_BEGIN, touchbeginlistener);
dispObj.addEventListener( TouchEvent.TOUCH_MOVE, touchmovelistener);
dispObj.addEventListener( TouchEvent.TOUCH_END, touchendlistener );
//dispObj.addEventListener( TouchEvent.TOUCH_TAP, mouseclicker);
}
public function definestickrange(x:int, y:int, d:int):void {
/*
if (device.deviceresolution == device.ANDROID) {
//Turn d into a sensible value
d = 6;
}else {
//Ignore it and just use 6
d = 6;
}
*/
controlstick_xrange = x;
controlstick_yrange = y;
deadzone = d;
deadzone_inner = Math.min(int(d * 0.5), 1);
}
public function gettouchx():int {
if (touchPoints == 0) {
return touchx[0];
}else {
return touchx[touchPoints - 1];
}
}
public function gettouchy():int {
if (touchPoints == 0) {
return touchy[0];
}else {
return touchy[touchPoints - 1];
}
}
/*
public function mouseUpListener( e:MouseEvent ):void {
//Identify the point that's been removed, and take it away from the array
touchPoints = 0;
if (touchPoints == 0){
press = false;
click = false;
clickheld = false;
hasclicked = false;
}
}
public function mouseDownListener( e:MouseEvent ):void {
touchx[0] = e.stageX;
touchy[0] = e.stageY;
touchid[0] = 1;
touchPoints=1;
press = true;
click = true;
clickheld = true;
hasclicked = true;
}
*/
public function touchbeginlistener( e:TouchEvent ):void {
touchx[touchPoints] = e.stageX;
touchy[touchPoints] = e.stageY;
touchid[touchPoints] = e.touchPointID;
if (controlstick == -1) {
//Consider this for the controlstick point
if (touchx[touchPoints] < controlstick_xrange) {
if (touchy[touchPoints] > controlstick_yrange) {
controlstick = touchid[touchPoints];
controlstick_x = touchx[touchPoints];
controlstick_y = touchy[touchPoints];
pushleft = false;
pushright = false;
firstmove = true;
}
}
}
touchPoints++;
press = true;
click = true;
clickheld = true;
hasclicked = true;
}
public function touchendlistener( e:TouchEvent ):void {
//Identify the point that's been removed, and take it away from the array
temptouchid = e.touchPointID;
if (temptouchid == controlstick) {
controlstick = -1;
pushleft = false;
pushright = false;
firstmove = false;
controlstick_x = -1;
controlstick_y = -1;
}
for (var i:int = 0; i < touchPoints; i++) {
if (touchid[i] == temptouchid) {
for (var j:int = i; j < touchPoints; j++) {
touchx[j] = touchx[j + 1];
touchy[j] = touchy[j + 1];
touchid[j] = touchid[j + 1];
}
i = touchPoints + 1;
touchPoints--;
}
}
if (touchPoints == 0){
press = false;
click = false;
clickheld = false;
hasclicked = false;
}
}
public function touchmovelistener(e:TouchEvent):void {
//Identify the touch point that's moving, and update it's coordinates
temptouchid = e.touchPointID;
for (var i:int = 0; i < touchPoints; i++) {
if (touchid[i] == temptouchid) {
touchx[i] = e.stageX;
touchy[i] = e.stageY;
if (touchid[i] == controlstick) {
if (firstmove) {
if (touchx[i] < controlstick_x) {
pushleft = true; pushright = false;
firstmove = false;
controlstick_x = touchx[i] + deadzone;
controlstick_y = touchy[i];
}else if (touchx[i] > controlstick_x) {
pushleft = false; pushright = true;
firstmove = false;
controlstick_x = touchx[i] - deadzone;
controlstick_y = touchy[i];
}
}else{
if (touchx[i] < controlstick_x - deadzone) {
pushleft = true; pushright = false;
controlstick_x = touchx[i] + deadzone;
controlstick_y = touchy[i];
}else if (touchx[i] > controlstick_x + deadzone) {
pushleft = false; pushright = true;
controlstick_x = touchx[i] - deadzone;
controlstick_y = touchy[i];
}else if (touchx[i] >= controlstick_x - deadzone_inner &&
touchx[i] <= controlstick_x + deadzone_inner) {
pushleft = false; pushright = false;
}
}
}
}
}
}
public function visitsite(t:String):void {
gotosite = t;
}
/*
public function mouseclicker(e:TouchEvent):void {
touchx = e.stageX;
touchy = e.stageY;
if (gotosite == "NG") {
//API.loadNewgrounds();
gotosite = "";
}else if (gotosite != "") {
var link:URLRequest = new URLRequest(gotosite);
navigateToURL(link, "_blank");
gotosite = "";
}
}
*/
private function keyDownListener( ev:KeyboardEvent ):void
{
states[ ev.keyCode >>> 3 ] |= 1 << (ev.keyCode & 7);
if (ev.keyCode == 27){
ev.preventDefault();
}else if (ev.keyCode == Keyboard.BACK) {
// user hit the back button on Android device
ev.preventDefault();
ev.stopImmediatePropagation();
}
}
private function keyUpListener( ev:KeyboardEvent ):void
{
states[ ev.keyCode >>> 3 ] &= ~(1 << (ev.keyCode & 7));
}
private function activateListener( ev:Event ):void
{
for( var i:int = 0; i < 8; ++i )
{
states[ i ] = 0;
}
}
private function deactivateListener( ev:Event ):void
{
for( var i:int = 0; i < 8; ++i )
{
states[ i ] = 0;
}
}
public function isDown( keyCode:uint ):Boolean
{
return ( states[ keyCode >>> 3 ] & (1 << (keyCode & 7)) ) != 0;
}
public function isUp( keyCode:uint ):Boolean
{
return ( states[ keyCode >>> 3 ] & (1 << (keyCode & 7)) ) == 0;
}
}
}

View File

@@ -0,0 +1,36 @@
package {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.net.*;
public class blockclass extends Sprite {
public function blockclass():void {
rect = new Rectangle();
clear();
}
public function clear():void{
active = false;
type = 0; trigger=0;
xp = 0; yp = 0; wp = 0; hp = 0;
rect.x = xp; rect.y = yp; rect.width = wp; rect.height = hp;
prompt = ""; script = ""; r = 0; g = 0; b = 0;
}
public function rectset(xi:int, yi:int, wi:int, hi:int):void {
rect.x = xi; rect.y = yi; rect.width = wi; rect.height = hi;
}
//Fundamentals
public var active:Boolean;
public var rect:Rectangle;
public var type:int;
public var trigger:int;
public var xp:int, yp:int, wp:int, hp:int;
public var script:String, prompt:String;
public var r:int, g:int, b:int;
}
};

View File

@@ -0,0 +1,57 @@
package {
public class device {
public static var DESKTOP:int = 0;
public static var MOBILE:int = 1;
public static var CONSOLE:int = 2;
public static var IPHONE:int = 1;
public static var IPHONERETINA:int = 2;
public static var IPAD:int = 3;
public static var IPADRETINA:int = 4;
public static var IPHONE5:int = 5;
public static var ANDROID:int = 6;
public static var OUYA:int = 7;
public static function init(t:int, r:int):void {
for (var i:int = 0; i < 20; i++) devicetext.push("");
if (t == 0) { // PC/MAC DESKTOP
devicetext[0] = "BACK - MENU";
devicetext[1] = "PRESS ACTION TO START";
devicetext[2] = "ACTION - STAGE SELECT";
devicetext[3] = "PRESS LEFT AND RIGHT KEYS";
devicetext[4] = "TO MOVE AROUND THE HEXAGON";
devicetext[5] = "PRESS ACTION TO CONTINUE";
devicetext[6] = "PRESS LEFT OR RIGHT TO RETRY";
devicetext[7] = "BACK - CREDITS";
devicetext[8] = "BACK - CANCEL";
devicetext[9] = "PRESS ACTION TO CONFIRM";
devicetext[10] = "C - CLEAR RECORDS";
devicetype = DESKTOP;
deviceresolution = DESKTOP;
}else if (t == 1) { //Mobile
devicetext[0] = "MAIN MENU";
devicetext[1] = "TAP TO START";
devicetext[2] = "STAGE SELECT";
devicetext[3] = "TOUCH THE LEFT AND RIGHT";
devicetext[4] = "SIDES OF THE SCREEN TO MOVE";
devicetext[5] = "TAP TO CONTINUE";
devicetext[6] = "TAP THE SCREEN TO RETRY";
devicetext[7] = "CREDITS";
devicetext[8] = "CANCEL";
devicetext[9] = "TAP TO CONFIRM";
devicetext[10] = "CLEAR RECORDS";
devicetype = MOBILE;
deviceresolution = r;
}
}
public static var devicetext:Vector.<String> = new Vector.<String>;
public static var devicetype:int;
public static var deviceresolution:int;
public static var xres:int, yres:int;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,22 @@
package {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.net.*;
public class edentitiesclass {
public function edentitiesclass():void {
clear();
}
public function clear():void{
x = 0; y = 0; t = 0;
p1 = 0; p2 = 0; p3 = 0; p4 = 0; p5 = 0; p6 = 0;
scriptname = "";
}
public var x:int, y:int, t:int;
public var scriptname:String;
public var p1:int, p2:int, p3:int, p4:int, p5:int, p6:int;
}
};

1499
mobile_version/src/editor.as Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,28 @@
package {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.net.*;
public class edlevelclass{
public function edlevelclass():void {
clear();
}
public function clear():void {
tileset = 0; tilecol = 0;
roomname = "";
warpdir = 0;
platx1 = 0; platy1 = 0; platx2 = 320; platy2 = 240; platv = 4;
enemyx1 = 0; enemyy1 = 0; enemyx2 = 320; enemyy2 = 240; enemytype = 0;
directmode = 0;
}
public var tileset:int, tilecol:int;
public var roomname:String;
public var warpdir:int;
public var platx1:int, platy1:int, platx2:int, platy2:int, platv:int;
public var enemyx1:int, enemyy1:int, enemyx2:int, enemyy2:int, enemytype:int;
public var directmode:int;
}
};

View File

@@ -0,0 +1,77 @@
package {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.net.*;
public class entclass extends Sprite {
public function entclass():void {
clear();
}
public function clear():void {
//Set all values to a default, required for creating a new entity
active = false; invis = false;
type = 0; size = 0; tile = 0; rule = 0;
state = 0; statedelay = 0; life = 0; colour = 0; para = 0;
behave = 0; animate = 0;
xp = 0; yp = 0; ax = 0; ay = 0; vx = 0; vy = 0;
w = 16; h = 16; cx = 0; cy = 0;
newxp = 0; newyp = 0;
x1 = 0; y1 = 0; x2 = 320; y2 = 240;
jumping = false; gravity = false; onground = 0; onroof = 0; jumpframe = 0;
onentity = 0; harmful = false; onwall = 0; onxwall = 0; onywall = 0; isplatform = false;
framedelay = 0; drawframe = 0; walkingframe = 0; dir = 0; actionframe = 0;
}
public function outside():Boolean {
//returns true if any point of the entity is outside the map. adjusts velocity for a clean collision.
if (xp < x1){
xp = x1;
return true;
}
if (yp < y1) {
yp = y1;
return true;
}
if (xp + w > x2) {
xp = x2 - w;
return true;
}
if (yp + h > y2) {
yp = y2 - h;
return true;
}
return false;
}
//Fundamentals
public var active:Boolean, invis:Boolean;
public var type:int, size:int, tile:int, rule:int;
public var state:int, statedelay:int;
public var behave:int, animate:int, para:int;
public var life:int, colour:int;
//Position and velocity
public var xp:Number, yp:Number, oldxp:Number, oldyp:Number;
public var ax:Number, ay:Number, vx:Number, vy:Number;
public var cx:int, cy:int, w:int, h:int;
public var newxp:Number, newyp:Number; //For collision functions
public var isplatform:Boolean;
public var x1:int, y1:int, x2:int, y2:int;
//Collision Rules
public var onentity:int;
public var harmful:Boolean;
public var onwall:int, onxwall:int, onywall:int;
//Platforming specific
public var jumping:Boolean, gravity:Boolean, onground:int, onroof:int;
public var jumpframe:int;
//Animation
public var framedelay:int, drawframe:int, walkingframe:int, dir:int, actionframe:int;
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,130 @@
package {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.net.*;
import flash.system.System;
public class helpclass extends Sprite {
public function init():void {
sine = new Array();
cosine = new Array();
for (i = 0; i < 64; i++) {
sine[i]=Math.sin((i*6.283)/64);
cosine[i]=Math.cos((i*6.283)/64);
}
for (i = 0; i < 30; i++) {
splitseconds.push(int((i * 60) / 30));
}
glow = 0;
glowdir = 0;
slowsine = 0;
}
public function booltoint(b:Boolean):int {
if (b) return 1;
return 0;
}
public function opa(t:int):int {
return (t + 32) % 64;
}
public function number(t:int):String {
switch(t) {
case 0: return "Zero"; break;
case 1: return "One"; break;
case 2: return "Two"; break;
case 3: return "Three"; break;
case 4: return "Four"; break;
case 5: return "Five"; break;
case 6: return "Six"; break;
case 7: return "Seven"; break;
case 8: return "Eight"; break;
case 9: return "Nine"; break;
case 10: return "Ten"; break;
case 11: return "Eleven"; break;
case 12: return "Twelve"; break;
case 13: return "Thirteen"; break;
case 14: return "Fourteen"; break;
case 15: return "Fifteen"; break;
case 16: return "Sixteen"; break;
case 17: return "Seventeen"; break;
case 18: return "Eighteen"; break;
case 19: return "Nineteen"; break;
case 20: return "Twenty"; break;
case 21: return "Twenty One"; break;
}
return "Some";
}
public function removeObject(obj:Object, arr:Array):void{
var b:String;
for (b in arr){
if (arr[b] == obj){
arr.splice(b,1)
break;
}
}
}
public function twodigits(t:int):String {
if (t < 10) return "0" + String(t);
if (t >= 100) return "??";
return String(t);
}
public function threedigits(t:int):String {
if (t < 10) return "0" + String(t);
if (t < 100) return "0" + String(t);
if (t >= 100) return String(t);
return String(t);
}
public function timestring(t:int):String {
//given a time t in frames, return a time in seconds
tempstring = "";
temp = (t - (t % 30)) / 30;
if (temp < 60) { //less than one minute
t = t % 30;
tempstring = String(temp) + ":" + twodigits(splitseconds[t]);
}else {
temp2 = (temp - (temp % 60)) / 60;
temp = temp % 60;
t = t % 30;
tempstring = String(temp2) + ":" + twodigits(temp) + ":" + twodigits(splitseconds[t]);
}
return tempstring;
}
public function updateglow():void {
slowsine++;
if (slowsine >= 64) slowsine = 0;
if (glowdir == 0) {
glow+=2;
if (glow >= 62) glowdir = 1;
}else {
glow-=2;
if (glow < 2) glowdir = 0;
}
}
public function toclipboard(t:String):void {
System.setClipboard(t);
}
public var sine:Array;
public var cosine:Array;
public var glow:int, slowsine:int;
public var glowdir:int;
public var globaltemp:int, globaltemp2:int, globaltemp3:int, temp:int, temp2:int, tempstring:String;
public var splitseconds:Array = new Array;
public var i:int;
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,816 @@
public function loadother(t:String):void {
//loads script name t into the array
if (t == "terminal_station_1") {
add("cutscene()");
add("untilbars()");
add("squeak(terminal)");
add("text(gray,0,60,1)");
add(" -= PERSONAL LOG =- ");
add("position(centerx)");
add("backgroundtext");
add("flipme");
add("speak");
add("text(gray,0,120,6)");
add(" Almost everyone has been ");
add(" evacuated from the space ");
add(" station now. The rest of us ");
add(" are leaving in a couple of ");
add(" days, once our research has ");
add(" been completed. ");
add("position(center)");
add("speak");
add("endtext");
add("endcutscene()");
add("untilbars()");
}else if (t == "alreadyvisited") {
add("squeak(player)");
add("text(cyan,0,0,1)");
add("...oh, I've already found this.");
add("position(player,above)");
add("speak_active");
add("endtext");
add("endcutscene()");
add("untilbars()");
}else if (t == "terminal_outside_1") {
add("cutscene()");
add("untilbars()");
add("squeak(terminal)");
add("text(gray,0,60,1)");
add(" -= Research Notes =- ");
add("position(centerx)");
add("backgroundtext");
add("flipme");
add("speak");
add("text(gray,0,114,5)");
add(" ... our first breakthrough was ");
add(" the creation of the inversion ");
add(" plane, which creates a ");
add(" mirrored dimension beyond a ");
add(" given event horizon ... ");
add("position(center)");
add("speak");
add("endtextfast");
add("delay(10)");
add("ifexplored(2,16,alreadyvisited)");
add("gamemode(teleporter)");
add("delay(20)");
add("squeak(terminal)");
add("showcoordinates(2,16)");
add("delay(10)");
add("hidecoordinates(2,16)");
add("delay(10)");
add("showcoordinates(2,16)");
add("delay(10)");
add("hidecoordinates(2,16)");
add("delay(10)");
add("showcoordinates(2,16)");
add("delay(45)");
add("gamemode(game)");
add("delay(20)");
add("endcutscene()");
add("untilbars()");
}else if (t == "terminal_outside_2") {
add("cutscene()");
add("untilbars()");
add("squeak(terminal)");
add("text(gray,0,60,1)");
add(" -= Research Notes =- ");
add("position(centerx)");
add("backgroundtext");
add("flipme");
add("speak");
add("text(gray,0,114,3)");
add("...with just a small modification to");
add("the usual parameters, we were able ");
add("to stabilise an infinite tunnel! ");
add("position(center)");
add("speak");
add("endtextfast");
add("delay(10)");
add("ifexplored(8,9,alreadyvisited)");
add("gamemode(teleporter)");
add("delay(20)");
add("squeak(terminal)");
add("showcoordinates(8,9)");
add("delay(10)");
add("hidecoordinates(8,9)");
add("delay(10)");
add("showcoordinates(8,9)");
add("delay(10)");
add("hidecoordinates(8,9)");
add("delay(10)");
add("showcoordinates(8,9)");
add("delay(45)");
add("gamemode(game)");
add("delay(20)");
add("endcutscene()");
add("untilbars()");
}else if (t == "terminal_outside_3") {
add("cutscene()");
add("untilbars()");
add("squeak(terminal)");
add("text(gray,0,60,1)");
add(" -= Research Notes =- ");
add("position(centerx)");
add("backgroundtext");
add("flipme");
add("speak");
add("text(gray,0,114,3)");
add(" ... the final step in creating ");
add(" the dimensional stabiliser was ");
add(" to create a feedback loop ... ");
add("position(center)");
add("speak");
add("endtextfast");
add("delay(10)");
add("ifexplored(14,1,alreadyvisited)");
add("gamemode(teleporter)");
add("delay(20)");
add("squeak(terminal)");
add("showcoordinates(14,1)");
add("delay(10)");
add("hidecoordinates(14,1)");
add("delay(10)");
add("showcoordinates(14,1)");
add("delay(10)");
add("hidecoordinates(14,1)");
add("delay(10)");
add("showcoordinates(14,1)");
add("delay(45)");
add("gamemode(game)");
add("delay(20)");
add("endcutscene()");
add("untilbars()");
}else if (t == "terminal_outside_4") {
add("cutscene()");
add("untilbars()");
add("squeak(terminal)");
add("text(gray,0,60,1)");
add(" -= Research Notes =- ");
add("position(centerx)");
add("backgroundtext");
add("flipme");
add("speak");
add("text(gray,0,114,4)");
add(" ...despite our best efforts, ");
add(" the dimensional stabiliser ");
add(" won't hold out forever. Its ");
add(" collapse is inevitable... ");
add("position(center)");
add("speak");
add("endtextfast");
add("delay(10)");
add("squeak(player)");
add("text(cyan,0,0,2)");
add("Huh? These coordinates aren't");
add("even in this dimension!");
add("position(player,above)");
add("speak_active");
add("endtext");
add("endcutscene()");
add("untilbars()");
}else if (t == "terminal_outside_5") {
add("cutscene()");
add("untilbars()");
add("squeak(terminal)");
add("text(gray,0,60,1)");
add(" -= Personal Log =- ");
add("position(centerx)");
add("backgroundtext");
add("flipme");
add("speak");
add("text(gray,0,114,5)");
add(" ... I've had to seal off ");
add(" access to most of our ");
add(" research. Who knows what ");
add(" could happen if it fell ");
add(" into the wrong hands? ... ");
add("position(center)");
add("speak");
add("endtextfast");
add("delay(10)");
add("gamemode(teleporter)");
add("delay(20)");
add("squeak(terminal)");
add("showsecretlab()");
add("delay(10)");
add("hidesecretlab()");
add("delay(10)");
add("showsecretlab()");
add("delay(10)");
add("hidesecretlab()");
add("delay(10)");
add("showsecretlab()");
add("delay(45)");
add("gamemode(game)");
add("delay(20)");
add("endcutscene()");
add("untilbars()");
}else if (t == "terminal_outside_6") {
add("cutscene()");
add("untilbars()");
add("squeak(terminal)");
add("text(gray,0,60,1)");
add(" -= Research Notes =- ");
add("position(centerx)");
add("backgroundtext");
add("flipme");
add("speak");
add("text(gray,0,114,3)");
add("... access to the control center");
add("is still possible through the ");
add("main atmospheric filters ... ");
add("position(center)");
add("speak");
add("endtextfast");
add("delay(10)");
add("ifexplored(12,14,alreadyvisited)");
add("gamemode(teleporter)");
add("delay(20)");
add("squeak(terminal)");
add("showcoordinates(12,14)");
add("delay(10)");
add("hidecoordinates(12,14)");
add("delay(10)");
add("showcoordinates(12,14)");
add("delay(10)");
add("hidecoordinates(12,14)");
add("delay(10)");
add("showcoordinates(12,14)");
add("delay(45)");
add("gamemode(game)");
add("delay(20)");
add("endcutscene()");
add("untilbars()");
}else if (t == "terminal_finallevel") {
add("cutscene()");
add("untilbars()");
add("squeak(terminal)");
add("text(gray,0,114,9)");
add("* DIMENSIONAL STABILITY GENERATOR *");
add("");
add(" [ Currently Generating ] ");
add(" Maximum Stability ");
add("");
add(" [ Status ]");
add(" Online");
add("");
add("READY _");
add("position(center)");
add("speak_active");
add("endtextfast");
add("delay(10)");
add("squeak(player)");
add("text(cyan,0,0,2)");
add("Aha! This must be what's" );
add("causing the interference!");
add("position(player,above)");
add("speak_active");
add("squeak(player)");
add("text(cyan,0,0,1)");
add("I wonder if I can turn it off?");
add("position(player,above)");
add("speak_active");
add("squeak(terminal)");
add("text(gray,0,114,4)");
add("WARNING: Disabling the Dimensional");
add("Stability Generator may lead to");
add("instability! Are you sure you want");
add("to do this?");
add("position(center)");
add("speak_active");
add("squeak(player)");
add("text(cyan,0,0,1)");
add("Yes!");
add("position(player,above)");
add("speak_active");
add("squeak(terminal)");
add("text(gray,0,114,6)");
add("Seriously! The whole dimension");
add("could collapse! Just think about");
add("this for a minute!");
add("");
add("Are you really sure you want");
add("to do this?");
add("position(center)");
add("speak_active");
add("squeak(player)");
add("text(cyan,0,0,1)");
add("Yes!");
add("position(player,above)");
add("speak_active");
add("endtext");
add("stopmusic");
add("gamestate(200)");
}else if (t == "finalterminal_finish") {
//add("delay(15)"); add("flash(5)"); add("shake(20)"); add("playef(9,10)");
add("text(gray,0,114,3)");
add(" -= WARNING =- ");
add("");
add(" DIMENSIONAL STABILISER OFFLINE ");
add("position(center)");
add("speak_active");
add("endtext");
add("squeak(cry)");
add("changemood(player,1)");
add("text(cyan,0,0,1)");
add("Uh oh...");
add("position(player,above)");
add("speak_active");
add("endtext");
add("play(2)");
add("changemood(player,0)");
add("endcutscene()");
add("untilbars()");
}else if (t == "terminal_station_2") {
add("cutscene()");
add("untilbars()");
add("squeak(terminal)");
add("text(gray,0,60,1)");
add(" -= Research Notes =- ");
add("position(centerx)");
add("backgroundtext");
add("flipme");
add("speak");
add("text(gray,0,114,3)");
add(" ...everything collapses, ");
add(" eventually. It's the way ");
add(" of the universe. ");
add("position(center)");
add("speak");
add("endtextfast");
add("endcutscene()");
add("untilbars()");
}else if (t == "terminal_station_3") {
add("cutscene()");
add("untilbars()");
add("squeak(terminal)");
add("text(gray,0,114,3)");
add("I wonder if the generator we set");
add("up in the polar dimension is");
add("what's affecting our teleporters?");
add("position(center)");
add("speak_active");
add("squeak(terminal)");
add("text(gray,0,114,1)");
add("No, it's probably just a glitch.");
add("position(center)");
add("speak_active");
add("endtext");
add("endcutscene()");
add("untilbars()");
}else if (t == "terminal_station_4") {
add("cutscene()");
add("untilbars()");
add("squeak(terminal)");
add("text(gray,0,60,1)");
add(" -= PERSONAL LOG =- ");
add("position(centerx)");
add("backgroundtext");
add("flipme");
add("speak");
add("text(gray,0,114,2)");
add(" Hah! Nobody will ever ");
add(" get this one. ");
add("position(center)");
add("speak");
add("endtextfast");
add("endcutscene()");
add("untilbars()");
}else if (t == "terminal_warp_1") {
add("cutscene()");
add("untilbars()");
add("squeak(terminal)");
add("text(gray,0,114,3)");
add("...The other day I was chased");
add("down a hallway by a giant cube");
add("with the word AVOID on it.");
add("position(center)");
add("speak_active");
add("squeak(terminal)");
add("text(gray,0,114,1)");
add("These security measures go too far!");
add("position(center)");
add("speak_active");
add("endtext");
add("endcutscene()");
add("untilbars()");
}else if (t == "terminal_warp_2") {
add("cutscene()");
add("untilbars()");
add("squeak(terminal)");
add("text(gray,0,114,2)");
add("The only way into my private lab");
add("anymore is by teleporter.");
add("position(center)");
add("speak_active");
add("squeak(terminal)");
add("text(gray,0,114,3)");
add("I've made sure that it's");
add("difficult for unauthorised");
add("personnel to gain access.");
add("position(center)");
add("speak_active");
add("endtext");
add("endcutscene()");
add("untilbars()");
}else if (t == "terminal_lab_1") {
add("cutscene()");
add("untilbars()");
add("squeak(terminal)");
add("text(gray,0,114,4)");
add("... it turns out the key to");
add("stabilising this dimension was");
add("to create a balancing force");
add("outside of it!");
add("position(center)");
add("speak_active");
add("squeak(terminal)");
add("text(gray,0,114,2)");
add("Though it looks like that's just");
add("a temporary solution, at best.");
add("position(center)");
add("speak_active");
add("squeak(terminal)");
add("text(gray,0,114,4)");
add("I've been working on");
add("something more permanent,");
add("but it seems it's going");
add("to be too late...");
add("position(center)");
add("speak_active");
add("endtext");
add("endcutscene()");
add("untilbars()");
}else if (t == "terminal_lab_2") {
add("cutscene()");
add("untilbars()");
add("squeak(terminal)");
add("text(gray,0,114,1)");
add("?SYNTAX ERROR");
add("position(center)");
add("speak_active");
add("endtext");
add("endcutscene()");
add("untilbars()");
}else if (t == "terminal_secretlab") {
add("cutscene()");
add("untilbars()");
add("squeak(terminal)");
add("text(gray,0,114,4)");
add(" -= WARNING =-");
add("");
add(" The Super-Gravitron is intended ");
add(" for entertainment purposes only. ");
add("position(center)");
add("speak_active");
add("squeak(terminal)");
add("text(gray,0,114,4)");
add("Anyone found using the Super");
add("Gravitron for educational");
add("purposes may be asked to");
add("stand in the naughty corner.");
add("position(center)");
add("speak_active");
add("endtext");
add("endcutscene()");
add("untilbars()");
}else if (t == "terminal_shipcomputer") {
add("cutscene()");
add("untilbars()");
add("squeak(terminal)");
add("text(gray,0,114,3)");
add(" -= D.S.S. SOULEYE =- ");
add("");
add(" Ship Navigation Controls ");
add("position(center)");
add("speak_active");
add("ifflag(67,terminal_letsgo)");
add("squeak(terminal)");
add("text(gray,0,114,3)");
add("Error! Error! Cannot isolate");
add("dimensional coordinates!");
add("Interference detected!");
add("position(center)");
add("speak_active");
add("endtext");
add("endcutscene()");
add("untilbars()");
}else if (t == "terminal_letsgo") {
add("squeak(player)");
add("text(player,0,0,2)");
add("Now that the ship is fixed,");
add("we can leave anytime we want!");
add("position(player,above)");
add("speak_active");
add("squeak(player)");
add("text(player,0,0,3)");
add("We've all agreed to");
add("keep exploring this");
add("dimension, though.");
add("position(player,above)");
add("speak_active");
add("squeak(player)");
add("text(player,0,0,1)");
add("Who knows what we'll find?");
add("position(player,above)");
add("speak_active");
add("endtext");
add("endcutscene()");
add("untilbars()");
}else if (t == "terminal_radio") {
add("cutscene()");
add("untilbars()");
add("squeak(terminal)");
add("text(gray,0,114,4)");
add(" -= SHIP RADIO =- ");
add("");
add(" [ Status ]");
add(" Broadcasting");
add("position(center)");
add("speak_active");
add("endtext");
add("endcutscene()");
add("untilbars()");
}else if (t == "terminal_jukebox") {
add("cutscene()");
add("untilbars()");
add("squeak(terminal)");
add("text(gray,0,114,7)");
add(" -= JUKEBOX =- ");
add("");
add(" Songs will continue to play ");
add(" until you leave the ship.");
add("");
add(" Collect trinkets to");
add(" unlock new songs!");
add("position(center)");
add("speak_active");
add("endtext");
add("iftrinketsless(5,terminal_jukeunlock1)");
add("iftrinketsless(8,terminal_jukeunlock2)");
add("iftrinketsless(10,terminal_jukeunlock3)");
add("iftrinketsless(12,terminal_jukeunlock4)");
add("iftrinketsless(14,terminal_jukeunlock41)");
add("iftrinketsless(16,terminal_jukeunlock5)");
add("iftrinketsless(18,terminal_jukeunlock6)");
add("iftrinketsless(20,terminal_jukeunlock7)");
add("endcutscene()");
add("untilbars()");
}else if (t == "terminal_jukeunlock1") {
add("squeak(terminal)");
add("text(gray,0,114,4)");
add(" NEXT UNLOCK: ");
add(" 5 Trinkets");
add("");
add(" Pushing onwards ");
add("position(center)");
add("speak_active");
add("endtext");
add("endcutscene()");
add("untilbars()");
}else if (t == "terminal_jukeunlock2") {
add("squeak(terminal)");
add("text(gray,0,114,4)");
add(" NEXT UNLOCK: ");
add(" 8 Trinkets");
add("");
add(" Positive force ");
add("position(center)");
add("speak_active");
add("endtext");
add("endcutscene()");
add("untilbars()");
}else if (t == "terminal_jukeunlock3") {
add("squeak(terminal)");
add("text(gray,0,114,4)");
add(" NEXT UNLOCK: ");
add(" 10 Trinkets");
add("");
add(" Presenting VVVVVV ");
add("position(center)");
add("speak_active");
add("endtext");
add("endcutscene()");
add("untilbars()");
}else if (t == "terminal_jukeunlock4") {
add("squeak(terminal)");
add("text(gray,0,114,4)");
add(" NEXT UNLOCK: ");
add(" 12 Trinkets");
add("");
add(" Potential for anything ");
add("position(center)");
add("speak_active");
add("endtext");
add("endcutscene()");
add("untilbars()");
}else if (t == "terminal_jukeunlock41") {
add("squeak(terminal)");
add("text(gray,0,114,4)");
add(" NEXT UNLOCK: ");
add(" 14 Trinkets");
add("");
add(" Pressure Cooker ");
add("position(center)");
add("speak_active");
add("endtext");
add("endcutscene()");
add("untilbars()");
}else if (t == "terminal_jukeunlock5") {
add("squeak(terminal)");
add("text(gray,0,114,4)");
add(" NEXT UNLOCK: ");
add(" 16 Trinkets");
add("");
add(" Predestined fate ");
add("position(center)");
add("speak_active");
add("endtext");
add("endcutscene()");
add("untilbars()");
}else if (t == "terminal_jukeunlock6") {
add("squeak(terminal)");
add("text(gray,0,114,4)");
add(" NEXT UNLOCK: ");
add(" 18 Trinkets");
add("");
add(" Popular Potpourri ");
add("position(center)");
add("speak_active");
add("endtext");
add("endcutscene()");
add("untilbars()");
}else if (t == "terminal_jukeunlock7") {
add("squeak(terminal)");
add("text(gray,0,114,4)");
add(" NEXT UNLOCK: ");
add(" 20 Trinkets");
add("");
add(" Pipe Dream ");
add("position(center)");
add("speak_active");
add("endtext");
add("endcutscene()");
add("untilbars()");
}else if (t == "terminal_juke1") {
add("play(4)");
add("squeak(terminal)");
add("jukebox(1)");
}else if (t == "terminal_juke2") {
add("play(1)");
add("squeak(terminal)");
add("jukebox(2)");
}else if (t == "terminal_juke3") {
add("play(2)");
add("squeak(terminal)");
add("jukebox(3)");
}else if (t == "terminal_juke4") {
add("play(6)");
add("squeak(terminal)");
add("jukebox(4)");
}else if (t == "terminal_juke5") {
add("play(3)");
add("squeak(terminal)");
add("jukebox(5)");
}else if (t == "terminal_juke6") {
add("play(8)");
add("squeak(terminal)");
add("jukebox(6)");
}else if (t == "terminal_juke7") {
add("play(11)");
add("squeak(terminal)");
add("jukebox(7)");
}else if (t == "terminal_juke8") {
add("play(10)");
add("squeak(terminal)");
add("jukebox(8)");
}else if (t == "terminal_juke9") {
add("play(12)");
add("squeak(terminal)");
add("jukebox(9)");
}else if (t == "terminal_juke10") {
add("play(9)");
add("squeak(terminal)");
add("jukebox(10)");
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,194 @@
package {
import flash.display.*;
import flash.media.*;
import flash.events.*;
public class musicclass extends Sprite {
//For Music stuff
public function play(t:int):void {
if (currentsong !=t) {
if (currentsong != -1) {
//Stop the old song first
musicchannel.stop();
if (currentsong != 0) {
musicchannel.removeEventListener(Event.SOUND_COMPLETE, loopmusic);
}
}
if (t != -1) {
musicfade = 0;
currentsong = t;
if (currentsong == 0 || currentsong == 7) {
//Level Complete theme, no fade in or repeat
musicchannel = musicchan[currentsong].play(0);
musicchannel.soundTransform = new SoundTransform(1.0);
}else {
musicfadein = 90;
musicchannel = musicchan[currentsong].play(0);
musicchannel.soundTransform = new SoundTransform(0);
musicchannel.addEventListener(Event.SOUND_COMPLETE, loopmusic);
}
}else {
currentsong = -1;
}
}
}
public function loopmusic(e:Event):void {
musicchannel.removeEventListener(Event.SOUND_COMPLETE, loopmusic);
if(currentsong>-1){
musicchannel = musicchan[currentsong].play();
musicchannel.addEventListener(Event.SOUND_COMPLETE, loopmusic);
}
}
public function stopmusic(e:Event):void {
musicchannel.removeEventListener(Event.SOUND_COMPLETE, stopmusic);
musicchannel.stop();
currentsong = -1;
}
public function haltdasmusik():void {
musicchannel.removeEventListener(Event.SOUND_COMPLETE, stopmusic);
musicchannel.stop();
resumesong = currentsong;
currentsong = -1;
}
public function silencedasmusik():void {
if(currentsong>-1){
musicchannel.soundTransform = new SoundTransform(0);
}
}
public function fadeout():void {
if(currentsong>-1){
if (musicfade == 0) {
musicchannel.removeEventListener(Event.SOUND_COMPLETE, stopmusic);
musicfade = 61;
}
}
}
public function processmusicfade():void {
musicfade--;
if (musicfade > 0) {
musicchannel.soundTransform = new SoundTransform(musicfade / 60);
}else {
musicchannel.stop();
currentsong = -1;
}
}
public function processmusicfadein():void {
musicfadein--;
if (musicfadein > 0) {
musicchannel.soundTransform = new SoundTransform((90-musicfadein) / 90 );
}else {
musicchannel.soundTransform = new SoundTransform(1.0);
}
}
public function processmusic():void {
if (musicfade > 0) processmusicfade();
if (musicfadein > 0) processmusicfadein();
if (nicefade == 1 && currentsong==-1) {
play(nicechange);
nicechange = -1; nicefade = 0;
}
musicstopother--;
if (musicstopother == 1) {
musicstopother = 0;
if (currentmusicchan == 0) musicchannel2.stop();
if (currentmusicchan == 1) musicchannel.stop();
}
if (musicstopother < 0) musicstopother = 0;
musicchancur--;
if (musicchancur <= 0 && currentsong > -1 && musicchanlen > 0) {
musicchancur = musicchanlen;
if (currentmusicchan == 0) {
musicchannel2 = musicchan[currentsong].play();
musicstopother = 3;
currentmusicchan = 1;
}else {
musicchannel = musicchan[currentsong].play();
musicstopother = 3;
currentmusicchan = 0;
}
}
}
public function niceplay(t:int):void {
//important: do nothing if the correct song is playing!
if(currentsong!=t){
if(currentsong!=-1) fadeout();
nicefade = 1;
nicechange = t;
}
}
public function musicroom(x:int, y:int):int {
return x + (y * 20);
}
public function changemusicarea(x:int, y:int):void {
switch(musicroom(x, y)) {
case musicroom(11, 4):
niceplay(2);
break;
case musicroom(2, 4):
case musicroom(7, 15):
niceplay(3);
break;
case musicroom(18, 1):
case musicroom(15, 0):
niceplay(12);
break;
case musicroom(0, 0):
case musicroom(0, 16):
case musicroom(2, 11):
case musicroom(7, 9):
case musicroom(8, 11):
case musicroom(13, 2):
case musicroom(17, 12):
case musicroom(14, 19):
case musicroom(17, 17):
niceplay(4);
break;
default:
niceplay(1);
break;
}
}
public var musicchan:Array = new Array();
public var musicchannel:SoundChannel, musicchannel2:SoundChannel;
public var currentmusicchan:int, musicchanlen:int, musicchancur:int, musicstopother:int, resumesong:int;
public var currentsong:int, musicfade:int, musicfadein:int;
public var nicefade:int, nicechange:int;
//Play a sound effect! There are 16 channels, which iterate
public function initefchannels():void {
for (var i:int = 0; i < 16; i++) efchannel.push(new SoundChannel);
}
public function playef(t:int, offset:int=0):void {
efchannel[currentefchan] = efchan[t].play(offset);
currentefchan++;
if (currentefchan > 15) currentefchan -= 16;
}
public var currentefchan:int;
public var efchannel:Array = new Array();
public var efchan:Array = new Array();
public var numplays:int;
}
}

View File

@@ -0,0 +1,25 @@
//Non gamecenter/steam platform specific specific code belongs here
package {
//import com.sticksports.nativeExtensions.SilentSwitch;
import flash.events.*;
import flash.media.SoundMixer;
import flash.media.AudioPlaybackMode;
public class platformclass {
public function init():void {
//SilentSwitch.apply();
SoundMixer.audioPlaybackMode = AudioPlaybackMode.AMBIENT;
}
public function callonwake():void {
//SilentSwitch.apply();
wakeupcall = 1;
}
public function callonsleep():void {
}
public var wakeupcall:int;
}
}

View File

@@ -0,0 +1,18 @@
package {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.net.*;
public class saveclass extends Sprite {
public function saveclass():void {
}
public var explored:Array;// = new Array();
public var flags:Array;// = new Array();
public var crewstats:Array;// = new Array();
public var collect:Array;// = new Array();
public var customcollect:Array;// = new Array();
public var moods:Array;// = new Array();
}
}

View File

@@ -0,0 +1,186 @@
package {
import com.milkmangames.nativeextensions.ios.*;
import com.milkmangames.nativeextensions.ios.events.*;
import flash.display.Stage;
public class scoreclass {
public function init(mystage:Stage):void {
if (!GameCenter.isSupported()){
trace("GameCenter is not supported on this platform.");
}
trace("Loading game center:");
gameCenter = GameCenter.create(mystage);
if(!GameCenter.gameCenter.isGameCenterAvailable()){
trace("this device doesn't have gamecenter.");
}
if (GameCenter.gameCenter.areBannersAvailable()){
GameCenter.gameCenter.showAchievementBanners(true);
}
gameCenter.addEventListener(GameCenterEvent.AUTH_SUCCEEDED,onAuthSucceeded);
gameCenter.addEventListener(GameCenterErrorEvent.AUTH_FAILED,onAuthFailed);
gameCenter.addEventListener(GameCenterEvent.ACHIEVEMENTS_VIEW_OPENED,onViewOpened);
gameCenter.addEventListener(GameCenterEvent.ACHIEVEMENTS_VIEW_CLOSED,onViewClosed);
gameCenter.addEventListener(GameCenterEvent.LEADERBOARD_VIEW_OPENED,onViewOpened);
gameCenter.addEventListener(GameCenterEvent.LEADERBOARD_VIEW_CLOSED,onViewClosed);
gameCenter.addEventListener(GameCenterEvent.ACHIEVEMENT_REPORT_SUCCEEDED,onAchievementReported);
gameCenter.addEventListener(GameCenterEvent.ACHIEVEMENT_RESET_SUCCEEDED,onAchievementReset);
gameCenter.addEventListener(GameCenterEvent.SCORE_REPORT_SUCCEEDED,onScoreReported);
gameCenter.addEventListener(GameCenterErrorEvent.SCORE_REPORT_FAILED,onScoreFailed);
gameCenter.addEventListener(GameCenterErrorEvent.ACHIEVEMENT_REPORT_FAILED,onAchievementFailed);
gameCenter.addEventListener(GameCenterErrorEvent.ACHIEVEMENT_RESET_FAILED,onResetFailed);
GameCenter.gameCenter.authenticateLocalUser();
}
CONFIG::iphonemode {
/** Check Authentication */
private function checkAuthentication():Boolean{
if (!GameCenter.gameCenter.isUserAuthenticated()){
trace("not logged in!");
return false;
}
return true;
}
/** Reset Achievements */
public function resetAchievements():void{
if (!checkAuthentication()) return;
GameCenter.gameCenter.resetAchievements();
}
public function reportScore(t:int):void{
// we make sure you're logged in before bothering to report the score.
// later iOS versions may take care of waiting/resubmitting for you, but earlier ones won't.
if (!checkAuthentication()) return;
t = t * 2; //Score is in 30 frame increments
GameCenter.gameCenter.reportScoreForCategory(t, "grp.supgravleaderboard");
}
public function opengamecenter():void {
if (!checkAuthentication()) return;
GameCenter.gameCenter.showLeaderboardForCategory("grp.supgravleaderboard");
}
/** Show Achievements */
public function showAchievements():void{
if (!checkAuthentication()) return;
//trace("showing achievements...");
try{
GameCenter.gameCenter.showAchievements();
}catch (e:Error){
//trace("ERR showachievements:"+e.message+"/"+e.name+"/"+e.errorID);
}
}
public var vvvvvvgamecomplete:int = 0;
public var vvvvvvgamecompleteflip:int = 1;
public var vvvvvvcomplete500:int = 2;
public var vvvvvvcomplete250:int = 3;
public var vvvvvvcomplete100:int = 4;
public var vvvvvvcomplete50:int = 5;
public var vvvvvvtimetrial_station1:int = 6;
public var vvvvvvtimetrial_lab:int = 7;
public var vvvvvvtimetrial_tower:int = 8;
public var vvvvvvtimetrial_station2:int = 9;
public var vvvvvvtimetrial_warp:int = 10;
public var vvvvvvtimetrial_final:int = 11;
public var vvvvvvsupgrav5:int = 12;
public var vvvvvvsupgrav10:int = 13;
public var vvvvvvsupgrav15:int = 14;
public var vvvvvvsupgrav20:int = 15;
public var vvvvvvsupgrav30:int = 16
public var vvvvvvsupgrav60:int = 17;
public var vvvvvvmaster:int = 18;
public function reportAchievement(t:int):void{
if (!checkAuthentication()) return;
// the '1.0' is a float (Number) value from 0.0-100.0 the percent completion of the achievement.
switch(t) {
case 0: GameCenter.gameCenter.reportAchievement("grp.vvvvvvgamecomplete", 100.0); break;
case 1: GameCenter.gameCenter.reportAchievement("grp.vvvvvvgamecompleteflip", 100.0); break;
case 2: GameCenter.gameCenter.reportAchievement("grp.vvvvvvcomplete500", 100.0); break;
case 3: GameCenter.gameCenter.reportAchievement("grp.vvvvvvcomplete250", 100.0); break;
case 4: GameCenter.gameCenter.reportAchievement("grp.vvvvvvcomplete100", 100.0); break;
case 5: GameCenter.gameCenter.reportAchievement("grp.vvvvvvcomplete50", 100.0); break;
case 6: GameCenter.gameCenter.reportAchievement("grp.vvvvvvtimetrial_station1", 100.0); break;
case 7: GameCenter.gameCenter.reportAchievement("grp.vvvvvvtimetrial_lab", 100.0); break;
case 8: GameCenter.gameCenter.reportAchievement("grp.vvvvvvtimetrial_tower", 100.0); break;
case 9: GameCenter.gameCenter.reportAchievement("grp.vvvvvvtimetrial_station2", 100.0); break;
case 10: GameCenter.gameCenter.reportAchievement("grp.vvvvvvtimetrial_warp", 100.0); break;
case 11: GameCenter.gameCenter.reportAchievement("grp.vvvvvvtimetrial_final", 100.0); break;
case 12: GameCenter.gameCenter.reportAchievement("grp.vvvvvvsupgrav5", 100.0); break;
case 13: GameCenter.gameCenter.reportAchievement("grp.vvvvvvsupgrav10", 100.0); break;
case 14: GameCenter.gameCenter.reportAchievement("grp.vvvvvvsupgrav15", 100.0); break;
case 15: GameCenter.gameCenter.reportAchievement("grp.vvvvvvsupgrav20", 100.0); break;
case 16: GameCenter.gameCenter.reportAchievement("grp.vvvvvvsupgrav30", 100.0); break;
case 17: GameCenter.gameCenter.reportAchievement("grp.vvvvvvsupgrav60", 100.0); break;
case 18: GameCenter.gameCenter.reportAchievement("grp.vvvvvvmaster", 100.0); break;
}
}
//
// Events
//
private function onAuthSucceeded(e:GameCenterEvent):void
{
trace("Auth succeeded!");
//showFullUI();
trace("auth player:" + GameCenter.gameCenter.getPlayerAlias() + "=" + GameCenter.gameCenter.getPlayerID() + ",underage?" + GameCenter.gameCenter.isPlayerUnderage());
gamecenteron = true;
}
private function onAuthFailed(e:GameCenterErrorEvent):void
{
trace("Auth failed:"+e.message);
//showAuthUI();
}
private function onViewOpened(e:GameCenterEvent):void
{
trace("gamecenter view opened.");
}
private function onViewClosed(e:GameCenterEvent):void
{
trace("gamecenter view closed.");
}
private function onAchievementReported(e:GameCenterEvent):void
{
trace("achievement report success:"+e.achievementID);
}
private function onAchievementFailed(e:GameCenterErrorEvent):void
{
trace("achievement report failed:msg="+e.message+",cd="+e.errorID+",ach="+e.achievementID);
}
private function onScoreReported(e:GameCenterEvent):void
{
trace("score report success:"+e.score+"/"+e.category);
}
private function onScoreFailed(e:GameCenterErrorEvent):void
{
trace("score report failed:msg="+e.message+",cd="+e.errorID+",scr="+e.score+",cat="+e.category);
}
private function onAchievementReset(e:GameCenterEvent):void
{
trace("achievements reset.");
//this.score=0;
//saveScore();
//this.txtScore.text="Score: "+score;
}
private function onResetFailed(e:GameCenterErrorEvent):void
{
trace("failed to reset:"+e.message);
}
}
CONFIG::iphonemode {
public var gameCenter:GameCenter;
public var gamecenteron:Boolean = true;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,107 @@
package {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.net.*;
public class textboxclass extends Sprite {
public function textboxclass():void {
firstcreate();
}
public function firstcreate():void {
//Like clear, only it creates the actual arrays, etc
for (iter = 0; iter < 10; iter++) {
var t:String = new String; t = "";
line.push(t);
}
x = 0; y = 0; w = 0; h = 0; numlines = 0; lw = 0; tl = 0; tm = 0; active = false; timer = 0;
}
public function clear():void {
//Set all values to a default, required for creating a new entity
for (iter = 0; iter < 12; iter++) {
line[iter]="";
}
textrect = new Rectangle();
xp = 0; yp = 0; w = 0; h = 0; numlines = 1; lw = 0; tl = 0; tm = 0; active = true; timer = 0;
}
public function centerx():void { resize(); xp = 160 - (w / 2); resize(); }
public function centery():void { resize(); yp = 120 - (h / 2); resize(); }
public function adjust():void {
resize();
if (xp < 10) xp = 10;
if (yp < 10) yp = 10;
if (xp + w > 310) xp = 310 - w;
if (yp + h > 230) yp = 230 - h;
resize();
}
public function initcol(rr:int, gg:int, bb:int):void {
tr = rr; tg = gg; tb = bb;
r = 0; g = 0; b = 0; tl = 0.5;
}
public function setcol(rr:int, gg:int, bb:int):void {
r = rr; g = gg; b = bb;
}
public function update():void {
if (tm == 0) {
tl += .1;
if (tl >= 1) { tl = 1; tm = 1; }
setcol(int(tr * tl), int(tg * tl), int(tb * tl));
}else if (tm == 2) {
tl -= .1;
if (tl <= 0.5) { tl = 0.5; active = false; }
setcol(int(tr * tl), int(tg * tl), int(tb * tl));
}
if (timer > 0) {
timer--;
if (timer == 0) tm = 2;
}
}
public function remove():void {
//tm = 2; tl = 1; //Remove mode
tm = 2; tl = 0.4; //Remove mode
}
public function removefast():void {
tm = 2; tl = 0.4; //Remove mode
}
public function resize():void {
//Set the width and height to the correct sizes
max = 0;
for (iter = 0; iter < numlines; iter++) if (line[iter].length > max) max = line[iter].length;
lw = max;
w = (max +2) * 8;
h = (numlines + 2) * 8;
textrect.x = xp; textrect.y = yp; textrect.width = w; textrect.height = h;
}
public function addline(t:String):void {
line[numlines] = t;
numlines++;
resize();
if (numlines >= 12) numlines = 0;
}
//Fundamentals
public var line:Array = new Array;
public var xp:int, yp:int, lw:int, w:int, h:int, numlines:int;
public var r:int, g:int, b:int;
public var tr:int, tg:int, tb:int;
public var textrect:Rectangle;
public var active:Boolean;
public var timer:int;
public var tl:Number, tm:int;
public var iter:int, max:int;
}
}

View File

@@ -0,0 +1,23 @@
package {
public class tmap {
public static function init():void {
for (var i:int = 0; i < 30; i++) {
contents.push("");
}
index = 0;
}
public static function reset():void {
index = 0;
}
public static function push(t:String):void {
contents[index] = t;
index++;
}
public static var contents:Vector.<String> = new Vector.<String>;
public static var index:int;
}
}