Monkey Island 2
// Creates boards and markers around mission Area
_xPos = position (_this select 0) select 0;
_yPos = position (_this select 0) select 1;
_howBigA = _this select 1;
_howBigB = _this select 2;
_tablesC = _this select 3;
_angle = _this select 4;
_i = 0;
while (_i < 360) do {
_x = (_howBighA * (sin _i));
_y = (_howBigB * (cos _i));
_x_rot = _xPos + _x*(cos _angle) - _y*(sin _angle);
_y_rot = _yPos + _x*(sin _angle) + _y*(cos _angle);
_k = createVehicle ["Danger", [_x_rot, _y_rot, 0], [], 0, "NONE"];
_m = createMarker [format ["Marker" + str _i], [_x_rot, _y_rot, 0]];
format ["Marker" + str _i] setMarkerType "Dot";
_k setDir _i;
format ["Marker" + str _i] setMarkerDir(_i - _angle);
_i = _i + 360/_tablesC;
};
script 137 (int dir)
{
if(!dir)
{
Floor_LowerByValue(DoorTag, 16, 64)
Ceiling_RaiseByValue(DoorTag, 16, 64)
Delay(120);
Floor_RaiseByValue(DoorTag, 16, 64)
Ceiling_LowerByValue(DoorTag, 16, 64)
}
}
func _process(delta):
# Get ball position and pad rectangles
var ball_pos = get_node("ball").get_pos()
var left_rect = Rect2(get_node("left").get_pos() - pad_size*0.5, pad_size)
var right_rect = Rect2(get_node("right").get_pos() - pad_size*0.5, pad_size)
# Integrate new ball position
ball_pos += direction*ball_speed*delta
# Flip, change direction and increase speed when touching pads
if ((left_rect.has_point(ball_pos) and direction.x < 0)
or (right_rect.has_point(ball_pos) and direction.x > 0)):
direction.x = -direction.x
ball_speed *= 1.1
direction.y = randf()*2.0 - 1
direction = direction.normalized()
...
Game Marker Language
Java
C#
TorqueScript
JavaScript
AngelScript
Squirrel
Python
Lua
GDScript
UnrealScript
Kotlin
TypeScript
ActionScript
// Duktape JS mapping
static void jsb_class_define_FileSystem(JSVM* vm) {
duk_context* ctx = vm->GetJSContext();
js_class_get_constructor(ctx, "Atomic", "FileSystem");
js_class_get_prototype(ctx, "Atomic", "FileSystem");
duk_pop_2(ctx);
js_class_get_prototype(ctx, "Atomic", "FileSystem");
duk_push_c_function(ctx, jsb_class_FileSystem_SetCurrentDir, 1);
duk_put_prop_string(ctx, -2, "setCurrentDir");
duk_push_c_function(ctx, jsb_class_FileSystem_CreateDir, 1);
duk_put_prop_string(ctx, -2, "createDir");
...
}
// CreateDir method
static int jsb_class_FileSystem_CreateDir(duk_context* ctx) {
String __arg0 = duk_to_string(ctx, 0);
duk_push_this(ctx);
FileSystem* native = js_to_class_instance<FileSystem>(ctx, -1, 0);
bool retValue = native->CreateDir(__arg0);
duk_push_boolean(ctx, retValue ? 1 : 0);
return 1;
}
// C++ <-> C# binding is much simpler
ATOMIC_EXPORT_API bool csb_Atomic_FileSystem_SetCurrentDir_4667(FileSystem* self, const char* pathName)
{
return self->SetCurrentDir(pathName ? String(pathName) : String::EMPTY);
}
ATOMIC_EXPORT_API bool csb_Atomic_FileSystem_CreateDir_4668(FileSystem* self, const char* pathName)
{
return self->CreateDir(pathName ? String(pathName) : String::EMPTY);
}
ATOMIC_EXPORT_API void csb_Atomic_FileSystem_SetExecuteConsoleCommands_4669(FileSystem* self, bool enable)
{
self->SetExecuteConsoleCommands(enable);
}
// ofvec2f 2D vectors mapping via luabridge library
luabridge::getGlobalNamespace(L)
.beginClass<ofVec2f>("ofVec2f")
.addConstructor<void(*)(float, float)>()
.addFunction(LUA_OPERATOR_PLUS,
static_cast<ofVec2f(ofVec2f::*)(const ofVec2f &)const>(&ofVec2f::operator+))
.addFunction(LUA_OPERATOR_MULT,
static_cast<ofVec2f(ofVec2f::*)(const ofVec2f &)const>(&ofVec2f::operator*))
.addFunction(LUA_OPERATOR_EQ,
static_cast<bool(ofVec2f::*)(const ofVec2f &)const>(&ofVec2f::operator==))
.addData("x", &ofVec2f::x)
.addData("y", &ofVec2f::y)
.addFunction("length", &ofVec2f::length)
.addFunction("lengthSquared", &ofVec2f::lengthSquared)
.endClass();
Adobe Photoshop Lightroom
Simcity 4
VLC Media Player
Far Cry
Civilization 5
Trading platforms
Wireshark
Supreme Commander
Angry Birds
World of Warcraft
Baldur's gate
Apache HTTP Server
MySQL Workbench
Escape From Monkey Island
local total, completed = GetNumCompletedAchievements();
if total > completed then
print("You have completed ", completed, " out of " ,total," achievements");
x= completed/total*100;
print("That is only ",x," percent");
end
export class IntroComponent extends Component {
private model: Model;
private factory: Factory;
onInit() {
this.model = this.scene.getGlobalAttribute(ATTR_MODEL);
this.sendMessage(MSG_GAME_STARTED);
this.factory = this.scene.getGlobalAttribute(ATTR_FACTORY);
this.scene.invokeWithDelay(5000, () => {
// set first level and reset the game
this.model.currentLevel = 1;
this.factory.resetGame(this.scene, this.model);
});
}
}
class ArkanoidIntroComponent : public Component {
private:
int introShowDelay = 5000;
int introShowTime = 0;
ArkanoidModel* model;
public:
virtual void Init() {
model = owner->GetRoot()->GetAttr<ArkanoidModel*>(ATTR_MODEL);
SendMsg(MSG_GAME_STARTED); // notify other components
}
virtual void Update(uint64_t delta, uint64_t absolute) {
introShowTime += delta;
if (introShowTime > introShowDelay) {
// go to the first level
model->currentLevel = 1;
owner->GetContext()->ResetGame();
}
}
};
ArkanoidIntroComponent = Component:Extend("ArkanoidIntroComponent")
function ArkanoidIntroComponent:Init()
self.model = self.owner:GetRoot():GetAttr_ARKANOID_MODEL()
self:SendMsg("MSG_GAME_STARTED")
local function reset()
self.model.currentLevel = 1
self.owner:GetContext():ResetGame()
end
self.scene.invokeWithDelay(5000, reset)
end
M-M-M-MONSTER KILL!