Awesome
OS2D is cross platform engine for 2d mobile games
OS2D is cross platform engine for 2d mobile games made with ObjectScript and Oxygine.
Build and run
Windows
Open and run <code>examples\Demo\proj.win32\Demo_vs2010.sln</code>. Please see more examples.
Android
Run <code>examples\Demo\proj.android\build-run.bat</code>
Getting Started
The main ObjectScript file is <code>Demo\data\main.os</code> of Demo example.
Examples of ObjectScript code:
// create sprite and display it
var sprite = Sprite()
sprite.resAnim = res.getResAnim("anim")
sprite.parent = stage
sprite.scale = 0.5
// run opacity and position tween using one action (see SeqTween example)
sprite.addTweenAction {
duration = 1.0, // in seconds
opacity = 0.5,
pos = vec2(100, 120),
ease = Ease.BACK_IN_OUT // ease type, it's linear by default
}
// run forever rotate action (see SeqTween example)
// rotate sprite in 2 seconds and repeat it forever
myAction = sprite.addAction(RepeatForeverAction(TweenAction{
duration = 2,
angle = 360,
name = "rotate-action"
}))
// remove action
sprite.removeAction(myAction)
// remove actions by name
sprite.removeActionsByName("rotate-action")
// handle event
sprite.addEventListener(TouchEvent.CLICK, function(ev){
// your code here
})
// handle user event
sprite.addEventListener("hide", function(ev){
// your code here
})
// dispatch user event
sprite.dispatchEvent{"hide", prop1 = "prop1", prop2 = 100}
// short syntax of initialization
// you could use any properties you want
sprite = Sprite().attrs {
resAnim = res.getResAnim("plus"),
scale = 0.5f,
pos = vec2(70, 55),
parent = stage,
}
// Actor is base class that could be rendered
// use it as group of actors, sprites and so on
actor = Actor().attachTo(stage)
// add update function that will be called each 0.3 seconds
// (see AngryMonsters examle)
myUpdate = actor.addUpdate(0.3, function(){
// your code here
})
// remove update function
actor.removeUpdate(myUpdate)
// add update function of each frame
actor.addUpdate(function(){
// your code here
})
// add timeout function to call in 2.5 seconds
// (see DemoFloor example)
actor.addTimeout(2.5, function(){
// your code here
})
Examples
CastleMonster
SeqTween
DemoFloor
AngryMonsters
Demo
ElasticTransition
eXeXeXeX
Resources
- OS2D is cross platform engine for 2d mobile games (examples included) made with ObjectScript and Oxygine
- OS2D binaries is OS2D binaries and executables examples for Windows
- CastleMonster is opensource old school battle mobile game made with OS2D
- CastleMonster binaries is CastleMonster binaries and executables files for Windows
- eXeXeXeX is opensource is a 4X genre of strategy-based video game made with OS2D
- eXeXeXeX binaries is eXeXeXeX binaries and executables files for Windows
- ObjectScript is ObjectScript language repository of full opensource code
- ObjectScript binaries is ObjectScript binaries and executables files for Windows (os.exe & os-fcgi.exe included)
- objectscript.org is ObjectScript site
- objectscript.org repo is ObjectScript site opensource code repository
- Programming in ObjectScript
- ObjectScript Reference
- ObjectScript C++ binder generator
##Contacts
Please feel free to contact me at anytime, my email is evgeniy.golovin@unitpoint.ru, skype: egolovin