Compare commits

...

41 Commits

Author SHA1 Message Date
Sven Slootweg b3a37d44e9 Fixes to preloader, fixes to drawing library, and changed around code structure for gemswap 10 years ago
Sven Slootweg 95b66de252 PreloadJS implementation, fixes, and console.log clean-up 10 years ago
Sven Slootweg e7297ab811 Separate experiments folder, gulpfile fixes, and general repo clean-up 10 years ago
Sven Slootweg 177e80336d Add createSprites convenience function 10 years ago
Sven Slootweg 12a0b150b5 Move loader definition 10 years ago
Sven Slootweg 808f8ecd17 Revert loading mechanism for nicer syntax 10 years ago
Sven Slootweg 709b1a9f19 Build process fixes, and significant overhaul of engine mechanics to facilitate preloading 10 years ago
Sven Slootweg 89507cf125 Looks like it works now! 10 years ago
Sven Slootweg 8f52e91bf3 Attempting to convince Git to stop playing with newlines 10 years ago
Sven Slootweg c4c22ee529 Set sprite dimensions as attributes, and allow for easing abortion 10 years ago
Sven Slootweg 3a8ed9bd36 Make gem tilting effect less intense 10 years ago
Sven Slootweg a77110950f Add npm clarification 10 years ago
Sven Slootweg 17b4acd3fe Formatting fix 10 years ago
Sven Slootweg 4e8929a0b8 Update README 10 years ago
Sven Slootweg 58bf7666a2 Add README 10 years ago
Sven Slootweg be537a9b32 That is no longer necessary. 10 years ago
Sven Slootweg 934859d92b External dependencies added, and Gulp build process configured. That only cost me half a soul... 10 years ago
Sven Slootweg 82a362a54b Combine click events 10 years ago
Sven Slootweg 8ba19bf92b Use different easing algo for gemswap tilting effect 10 years ago
Sven Slootweg ca333b8901 Add easing to gemswap cursor 10 years ago
Sven Slootweg 247975216b Make stacked easing not break chained easing, by correctly passing on end values for consecutive easings. 10 years ago
Sven Slootweg b594fe3e05 Allow for stacked easings through recalculation of the change on each easing value update 10 years ago
Sven Slootweg 29aab13dcd Basic easing demo, and some mouse event handling stuff 10 years ago
Sven Slootweg 2e4582b149 Quad easing functions 10 years ago
Sven Slootweg bca21d496b Linear easing function 10 years ago
Sven Slootweg 7afceec382 Expo easing functions 10 years ago
Sven Slootweg 85658ad24b Fixes for elastic easing functions - but they're still broken 10 years ago
Sven Slootweg 7cf000ce21 Elastic easing functions 10 years ago
Sven Slootweg ed13af354f Cubic easing functions 10 years ago
Sven Slootweg 24c6e785a1 Move shimmer effect to an easing function, and fix circInOut easing bug 10 years ago
Sven Slootweg 3d35f95c15 Add inverse repeats 10 years ago
Sven Slootweg b379187f4f Tweaks 10 years ago
Sven Slootweg 3713464ecb WHOO EASE CHAINING! 10 years ago
Sven Slootweg 7bf498dec2 Changes to the way Ease objects are updated 10 years ago
Sven Slootweg 40ff211362 Revert changes in draw methods; Ease objects will pretend to be primitives instead 10 years ago
Sven Slootweg 4202895988 Fixes 10 years ago
Sven Slootweg 0b51cde152 Timing and part of easing algorithms 10 years ago
Sven Slootweg 783bcc7d3b More updates and stuff 10 years ago
Sven Slootweg 4cccde754c Changes and stuff 10 years ago
Sven Slootweg 05b6972f7d Initial commit for CoffeeScript rewrite 10 years ago
Sven Slootweg 7839380419 Initial commit for rewrite 11 years ago

2
.gitignore vendored

@ -0,0 +1,2 @@
/node_modules/
/npm-debug.log

@ -0,0 +1,40 @@
# Radium
A game engine, under development. Currently being rewritten in Coffeescript.
## Setup
To install dependencies you need for developing on Radium: `npm install`. If you don't have `npm`, install NodeJS - npm is included.
Note that `coffee-script` may fail to install; in that case, you'll need to install it manually (and you can ignore the error from the previous command): `sudo npm install -g coffee-script`
To run the build scripts in development mode, automatically recompiling both engine and sample game code as files are changed: `gulp watch`
To compile and minify engine and sample games for production: `gulp`
If you want more fine-grained control...
* `gulp dev` compiles everything in development mode (not minified)
* `gulp prod`, which `gulp` is an alias for, compiles everything in production mode (minified)
* `gulp dev-engine` compiles the engine in development mode
* `gulp prod-engine` compiles the engine in production mode
* `gulp dev-gemswap` compiles gemswap in development mode
* `gulp prod-gemswap` compiles gemswap in production mode
That's it!
## Documentation
None! Sorry, you'll have to wait for first release, or look at the samples/engine code.
## License
[WTFPL](http://www.wtfpl.net/) or [CC0](https://creativecommons.org/publicdomain/zero/1.0/), as usual.
## External libraries
This project uses the following external libraries:
* jQuery by the jQuery foundation, [MIT license](https://jquery.org/license/)
* PreloadJS by gSkinner.com, [MIT license](https://github.com/CreateJS/PreloadJS/blob/master/LICENSE)
* SoundJS by gSkinner.com, [MIT license](https://github.com/CreateJS/SoundJS/blob/master/LICENSE)

@ -0,0 +1,17 @@
# TODO list
## Behavioural bugs
* Ensure that object association is not lost when a Timer is fired for an object.
## Visual bugs
* Make the first frame draw correctly, without requiring a `return true` from the onStep event.
## Build process
* Add build-games.sh functionality (ie. SVG-to-PNG export) to gulpfile.
## Ideas
jQuery-like $ selector on scene objects (ie. @$) for selecting instances by name, coordinates, etc.

@ -0,0 +1,7 @@
for f in gemswap/source/*.svg
do
name=${f%%.*}
name=${name##*/}
echo "Processing $f..."
inkscape --export-png=gemswap/assets/images/$name.png $f
done

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,224 +0,0 @@
/* Thanks to http://phrogz.net/js/classes/OOPinJS2.html */
Function.prototype.inheritsFrom = function(parentObject)
{
if(parentObject.constructor == Function)
{
/* Normal Inheritance */
this.prototype = new parentObject;
this.prototype.constructor = this;
this.prototype.parent = parentObject.prototype;
}
else
{
/* Pure Virtual Inheritance */
this.prototype = parentObject;
this.prototype.constructor = this;
this.prototype.parent = parentObject;
}
return this;
}
/*Class*/ RadiumEngine = function()
{
this.version = "1.0";
var /*Exception*/ Exception = this.Exception = function(message)
{
this.message = message;
}
var /*Exception*/ Warning = this.Warning = function(message)
{
this.message = message;
}
var /*Exception*/ ResourceException = this.ResourceException = function(message, resource, action)
{
this.resource = resource;
this.message = message;
this.action = action;
}
ResourceException.inheritsFrom(Exception);
var /*Exception*/ ResourceWarning = this.ResourceWarning = function(message, resource, action)
{
this.resource = resource;
this.message = message;
this.action = action;
}
ResourceWarning.inheritsFrom(Warning);
var /*Class*/ Player = this.Player = function()
{
this.credits = 0; /* Integer */
this.health = 1; /* Fraction */
this.resources = {}; /* Associative array -> Resource */
this.InitializeResource = function(resource, negative_allowed, min, max)
{
var resource_object = new Resource();
resource_object.name = resource;
if(negative_allowed !== undefined)
{
resource_object.negative_allowed = negative_allowed;
}
if(min !== undefined)
{
resource_object.minimum = min;
}
if(min !== undefined)
{
resource_object.maximum = max;
}
if(min != null && min > 0)
{
/* Set current amount of units to minimum boundary. */
resource_object.value = min;
}
this.resources[resource] = resource_object;
}
this.TakeResource = function(resource, amount)
{
if(this.resources[resource])
{
resource_object = this.resources[resource];
if(resource_object.value - amount < 0 && resource_object.negative_allowed == false)
{
throw new ResourceException("There are not enough units of this resource available.", resource, "take");
}
else if(resource_object.minimum != null && resource_object.value - amount < resource_object.minimum)
{
throw new ResourceException("Taking away this many units will violate the lower resource boundary.", resource, "take");
}
else
{
resource_object.value -= amount;
}
}
else
{
throw new ResourceException("This resource does not exist.", resource, "take");
}
}
this.GiveResource = function(resource, amount)
{
if(this.resources[resource])
{
resource_object = this.resources[resource];
if(resource_object.maximum != null && resource_object.value + amount > resource_object.maximum)
{
resource_object.value = resource_object.maximum;
throw new ResourceWarning("The upper boundary of the resource was reached.", resource, "give");
}
else
{
resource_object.value += amount;
}
}
else
{
throw new ResourceException("This resource does not exist.", resource, "give");
}
}
this.SetResource = function(resource, amount)
{
if(this.resources[resource])
{
resource_object = this.resources[resource];
if(resource_object.minimum != null && amount < resource_object.minimum)
{
throw new ResourceException("The specified amount is lower than the lower boundary of the resource.", resource, "set");
}
else if(resource_object.maximum != null && amount > resource_object.maximum)
{
throw new ResourceException("The specified amount is lower than the lower boundary of the resource.", resource, "set");
}
else if(resource_object.negative_allowed === false && amount < 0)
{
throw new ResourceException("This resource cannot be set to a negative amount.", resource, "set");
}
else
{
resource_object.value = amount;
}
}
else
{
throw new ResourceException("This resource does not exist.", resource, "set");
}
}
}
var /*Class*/ Resource = this.Resource = function()
{
this.name = "Unnamed resource";
this.negative_allowed = false;
this.minimum = null;
this.maximum = null;
this.value = 0;
}
var /*Static Class*/ Point = RadiumEngine.Point = function(x, y)
{
this.x = x;
this.y = y;
this.Add = function()
{
var new_point = new RadiumEngine.Point(this.x, this.y);
for (i in arguments)
{
new_point.x += arguments[i].x;
new_point.y += arguments[i].y;
}
return new_point;
}
this.Subtract = function()
{
var new_point = new RadiumEngine.Point(this.x, this.y);
for (i in arguments)
{
new_point.x -= arguments[i].x;
new_point.y -= arguments[i].y;
}
return new_point;
}
}
var /*Static*/ point_distance = RadiumEngine.point_distance = function(x1, y1, x2, y2)
{
var xL = x1 - x2;
var yL = y1 - y2;
return Math.sqrt((xL * xL) + (yL * yL));
}
RadiumEngine.dot_product = function(a, b)
{
var n = 0;
var lim = Math.min(a.length, b.length);
for (var i = 0; i < lim; i++)
{
n += a[i] * b[i];
}
return n;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

@ -0,0 +1,8 @@
body {
background-color: #e0e0e0; }
#gamecanvas {
background-color: white;
margin: 0px auto; }
/*# sourceMappingURL=style.css.map */

@ -0,0 +1,7 @@
{
"version": 3,
"file": "",
"sources": ["style.scss"],
"names": [],
"mappings": "AAAA;EAEC,kBAAkB;;AAGnB;EAEC,kBAAkB;EAClB,QAAQ"
}

@ -0,0 +1,10 @@
body
{
background-color: #e0e0e0;
}
#gamecanvas
{
background-color: white;
margin: 0px auto;
}

@ -0,0 +1,11 @@
<html>
<head>
<title>Drag Experiment</title>
<link rel="stylesheet" href="assets/style.css">
<script src="../compiled/radium.js"></script>
<script src="drag.js"></script>
</head>
<body>
<canvas id="gamecanvas"></canvas>
</body>
</html>

@ -0,0 +1,27 @@
(function () {$(function() {
var engine, manager;
manager = new ResourceManager("assets");
engine = new Engine(manager);
window.debug_engine = engine;
manager.addImages(["ball.png"]);
return manager.prepare(function() {
engine.addCanvas($("#gamecanvas"));
engine.setInitialScene(engine.createScene("main"));
return manager.load(function() {
var ball;
engine.createSprites({
"ball": "ball.png"
});
ball = engine.createObject("ball");
ball.sprite = engine.getSprite("ball");
ball.onStep = function() {
return true;
};
engine.getScene("main").onLoad = function() {
return this.createInstance(ball, 0, 0);
};
return engine.start();
});
});
});
})();

@ -0,0 +1,37 @@
$(->
manager = new ResourceManager("assets")
engine = new Engine(manager)
window.debug_engine = engine
# Configure game assets
manager.addImages([
"ball.png"
])
manager.prepare ->
# Set up the engine
engine.addCanvas($("#gamecanvas"));
engine.setInitialScene(engine.createScene("main"))
manager.load ->
# Game asset initialization...
engine.createSprites({
"ball": "ball.png",
})
# Object definitions
ball = engine.createObject("ball")
ball.sprite = engine.getSprite("ball")
ball.onStep = ->
return true
# Scene configuration
engine.getScene("main").onLoad = ->
# Actual game initialization
@createInstance(ball, 0, 0)
# Let's go!
engine.start()
)

@ -0,0 +1,11 @@
<html>
<head>
<title>Easing Experiment</title>
<link rel="stylesheet" href="assets/style.css">
<script src="../compiled/radium.js"></script>
<script src="easing.js"></script>
</head>
<body>
<canvas id="gamecanvas"></canvas>
</body>
</html>

@ -0,0 +1,31 @@
(function () {$(function() {
var engine, manager;
manager = new ResourceManager("assets");
engine = new Engine(manager);
window.debug_engine = engine;
manager.addImages(["ball.png"]);
return manager.prepare(function() {
engine.addCanvas($("#gamecanvas"));
engine.setInitialScene(engine.createScene("main"));
return manager.load(function() {
var ball;
engine.createSprites({
"ball": "ball.png"
});
ball = engine.createObject("ball");
ball.sprite = engine.getSprite("ball");
ball.onStep = function() {
return true;
};
ball.onClickGlobal = function(event) {
this.x = this.engine.ease.quadInOut(this.x, event.x - 41, 35);
return this.y = this.engine.ease.quadInOut(this.y, event.y - 41, 35);
};
engine.getScene("main").onLoad = function() {
return this.createInstance(ball, 0, 0);
};
return engine.start();
});
});
});
})();

@ -0,0 +1,41 @@
$(->
manager = new ResourceManager("assets")
engine = new Engine(manager)
window.debug_engine = engine
# Configure game assets
manager.addImages([
"ball.png"
])
manager.prepare ->
# Set up the engine
engine.addCanvas($("#gamecanvas"));
engine.setInitialScene(engine.createScene("main"))
manager.load ->
# Game asset initialization...
engine.createSprites({
"ball": "ball.png",
})
# Object definitions
ball = engine.createObject("ball")
ball.sprite = engine.getSprite("ball")
ball.onStep = ->
return true
ball.onClickGlobal = (event) ->
@x = @engine.ease.quadInOut(@x, event.x - 41, 35)
@y = @engine.ease.quadInOut(@y, event.y - 41, 35)
# Scene configuration
engine.getScene("main").onLoad = ->
# Actual game initialization
@createInstance(ball, 0, 0)
# Let's go!
engine.start()
)

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1,13 @@
<!doctype html>
<html>
<head>
<title>Gemswap</title>
<script src="compiled/radium.js"></script>
<script src="gemswap/gemswap.js"></script>
<link rel="stylesheet" href="gemswap/gemswap.css">
</head>
<body>
<canvas id="gamecanvas"></canvas>
<div id="debug"></div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

@ -0,0 +1,115 @@
$(->
manager = new ResourceManager("gemswap/assets")
engine = new Engine(manager)
window.debug_engine = engine
###
# Configure pre-loading assets
manager.addImages([
"images/loading_screen.png"
], true)
###
# Configure game assets
manager.addImages([
"images/cursor.png"
"images/diamond.png"
"images/diamond_inverted.png"
"images/diamond_shimmer.png"
"images/yellow.png"
"images/yellow_inverted.png"
"images/yellow_shimmer.png"
"images/blue.png"
"images/blue_inverted.png"
"images/blue_shimmer.png"
])
###manager.addSounds([
"music/music.wav"
])###
# Set up the engine
engine.addCanvas($("#gamecanvas"));
engine.setPreloadScene(engine.createScene("loader"))
engine.setInitialScene(engine.createScene("main"))
manager.prepare ->
# Let's go!
engine.start()
# Scene configuration
engine.getScene("loader").onLoad = ->
# Loading screen
@createInstance("loader", 0, 0)
engine.getScene("main").onLoad = ->
# Actual game initialization
@createInstance("cursor", 0, 0)
for x in [10 .. 728] by 80
for y in [10 .. 550] by 80
@createInstance("diamond", x, y)
# Loader object
loader = engine.createObject("loader")
loader.onStep = -> true
loader.onDraw = ->
engine.draw.rectangle(0, 0, 800 * manager.file_progress, 64, {fillColor: "#CCCCCC", fill: true})
engine.draw.rectangle(0, 64, 800 * manager.total_progress, 128, {fillColor: "#AAAAAA", fill: true})
manager.load ->
# Game asset initialization...
engine.createSprites({
"cursor": "images/cursor.png",
"diamond": "images/diamond.png",
"diamond_inverted": "images/diamond_inverted.png",
"diamond_shimmer": "images/diamond_shimmer.png",
"yellow": "images/yellow.png",
"yellow_inverted": "images/yellow_inverted.png",
"yellow_shimmer": "images/yellow_shimmer.png",
"blue": "images/blue.png",
"blue_inverted": "images/blue_inverted.png",
"blue_shimmer": "images/blue_shimmer.png",
})
# Object definitions
cursor = engine.createObject("cursor")
cursor.sprite = engine.getSprite("cursor")
cursor.onStep = ->
$("#debug").html("Mouse coords: #{@scene.mouse_x} / #{@scene.mouse_y}<br>Frameskip: #{@engine.frameskip}")
cursor.onDraw = ->
#engine.draw.rectangle(20, 20, 400, 400, {fillColor: "#FFFFFF", fill: true})
diamond = engine.createObject("diamond")
diamond.sprite = engine.getSprite("diamond")
diamond.draw_sprite = false
diamond.onCreate = ->
@fade_value = 0.3
@shimmer_value = @engine.ease.circInOut(0, 0.8, engine.random.number(200, 350), null, true, true)
@gem_type = @engine.random.pick("diamond", "yellow", "blue")
diamond.onStep = ->
return true
diamond.onDraw = ->
@engine.getSprite(@gem_type).draw(@x, @y)
@engine.getSprite("#{@gem_type}_inverted").draw(@x, @y, {
alpha: @fade_value
})
@engine.getSprite("#{@gem_type}_shimmer").draw(@x - 14, @y - 14, {
alpha: @shimmer_value
})
diamond.onMouseOver = ->
@fade_value = @engine.ease.quadInOut(0.3, 0.7, 10, @engine.ease.bounceOut(0.7, 0.3, 65))
cursor = @engine.getObject("cursor").getInstances()[0]
cursor.x = @engine.ease.quadInOut(cursor.x, @x - 9, 8)
cursor.y = @engine.ease.quadInOut(cursor.y, @y - 9, 8)
)

@ -0,0 +1,12 @@
body
{
text-align: center;
background-color: #000000;
color: white;
}
#gamecanvas
{
width: 800px;
height: 600px;
}

@ -0,0 +1,107 @@
(function () {$(function() {
var engine, manager;
manager = new ResourceManager("gemswap/assets");
engine = new Engine(manager);
window.debug_engine = engine;
/*
* Configure pre-loading assets
manager.addImages([
"images/loading_screen.png"
], true)
*/
manager.addImages(["images/cursor.png", "images/diamond.png", "images/diamond_inverted.png", "images/diamond_shimmer.png", "images/yellow.png", "images/yellow_inverted.png", "images/yellow_shimmer.png", "images/blue.png", "images/blue_inverted.png", "images/blue_shimmer.png"]);
/*manager.addSounds([
"music/music.wav"
])
*/
engine.addCanvas($("#gamecanvas"));
engine.setPreloadScene(engine.createScene("loader"));
engine.setInitialScene(engine.createScene("main"));
return manager.prepare(function() {
var loader;
engine.start();
engine.getScene("loader").onLoad = function() {
return this.createInstance("loader", 0, 0);
};
engine.getScene("main").onLoad = function() {
var x, y, _i, _results;
this.createInstance("cursor", 0, 0);
_results = [];
for (x = _i = 10; _i <= 728; x = _i += 80) {
_results.push((function() {
var _j, _results1;
_results1 = [];
for (y = _j = 10; _j <= 550; y = _j += 80) {
_results1.push(this.createInstance("diamond", x, y));
}
return _results1;
}).call(this));
}
return _results;
};
loader = engine.createObject("loader");
loader.onStep = function() {
return true;
};
loader.onDraw = function() {
engine.draw.rectangle(0, 0, 800 * manager.file_progress, 64, {
fillColor: "#CCCCCC",
fill: true
});
return engine.draw.rectangle(0, 64, 800 * manager.total_progress, 128, {
fillColor: "#AAAAAA",
fill: true
});
};
return manager.load(function() {
var cursor, diamond;
engine.createSprites({
"cursor": "images/cursor.png",
"diamond": "images/diamond.png",
"diamond_inverted": "images/diamond_inverted.png",
"diamond_shimmer": "images/diamond_shimmer.png",
"yellow": "images/yellow.png",
"yellow_inverted": "images/yellow_inverted.png",
"yellow_shimmer": "images/yellow_shimmer.png",
"blue": "images/blue.png",
"blue_inverted": "images/blue_inverted.png",
"blue_shimmer": "images/blue_shimmer.png"
});
cursor = engine.createObject("cursor");
cursor.sprite = engine.getSprite("cursor");
cursor.onStep = function() {
return $("#debug").html("Mouse coords: " + this.scene.mouse_x + " / " + this.scene.mouse_y + "<br>Frameskip: " + this.engine.frameskip);
};
cursor.onDraw = function() {};
diamond = engine.createObject("diamond");
diamond.sprite = engine.getSprite("diamond");
diamond.draw_sprite = false;
diamond.onCreate = function() {
this.fade_value = 0.3;
this.shimmer_value = this.engine.ease.circInOut(0, 0.8, engine.random.number(200, 350), null, true, true);
return this.gem_type = this.engine.random.pick("diamond", "yellow", "blue");
};
diamond.onStep = function() {
return true;
};
diamond.onDraw = function() {
this.engine.getSprite(this.gem_type).draw(this.x, this.y);
this.engine.getSprite("" + this.gem_type + "_inverted").draw(this.x, this.y, {
alpha: this.fade_value
});
return this.engine.getSprite("" + this.gem_type + "_shimmer").draw(this.x - 14, this.y - 14, {
alpha: this.shimmer_value
});
};
return diamond.onMouseOver = function() {
this.fade_value = this.engine.ease.quadInOut(0.3, 0.7, 10, this.engine.ease.bounceOut(0.7, 0.3, 65));
cursor = this.engine.getObject("cursor").getInstances()[0];
cursor.x = this.engine.ease.quadInOut(cursor.x, this.x - 9, 8);
return cursor.y = this.engine.ease.quadInOut(cursor.y, this.y - 9, 8);
};
});
});
});
})();

@ -0,0 +1 @@
(function(){$(function(){var e,i;return i=new ResourceManager("gemswap/assets"),e=new Engine(i),window.debug_engine=e,i.addImages(["images/cursor.png","images/diamond.png","images/diamond_inverted.png","images/diamond_shimmer.png","images/yellow.png","images/yellow_inverted.png","images/yellow_shimmer.png","images/blue.png","images/blue_inverted.png","images/blue_shimmer.png"]),i.prepare(),i.preload(null,function(){var i,n,t,r,a,s,m;for(e.addCanvas($("#gamecanvas")),t=e.createScene("main"),e.createSprite("cursor","images/cursor.png"),e.createSprite("diamond","images/diamond.png"),e.createSprite("diamond_inverted","images/diamond_inverted.png"),e.createSprite("diamond_shimmer","images/diamond_shimmer.png"),e.createSprite("yellow","images/yellow.png"),e.createSprite("yellow_inverted","images/yellow_inverted.png"),e.createSprite("yellow_shimmer","images/yellow_shimmer.png"),e.createSprite("blue","images/blue.png"),e.createSprite("blue_inverted","images/blue_inverted.png"),e.createSprite("blue_shimmer","images/blue_shimmer.png"),i=e.createObject("cursor"),i.sprite=e.getSprite("cursor"),n=e.createObject("diamond"),n.sprite=e.getSprite("diamond"),n.draw_sprite=!1,n.onCreate=function(){return this.fade_value=0,this.shimmer_value=this.engine.ease.circInOut(0,.8,e.random.number(200,350),null,!0,!0),this.gem_type=this.engine.random.pick("diamond","yellow","blue")},n.onStep=function(){return!0},n.onDraw=function(){return this.engine.getSprite(this.gem_type).draw(this.x,this.y),this.engine.getSprite(""+this.gem_type+"_inverted").draw(this.x,this.y,{alpha:this.fade_value}),this.engine.getSprite(""+this.gem_type+"_shimmer").draw(this.x-14,this.y-14,{alpha:this.shimmer_value})},n.onMouseOver=function(){return this.fade_value=this.engine.ease.quadInOut(0,1,10,this.engine.ease.bounceOut(1,0,35)),i=this.engine.getObject("cursor").getInstances()[0],i.x=this.engine.ease.quadInOut(i.x,this.x-9,8),i.y=this.engine.ease.quadInOut(i.y,this.y-9,8)},r=s=10;728>=s;r=s+=80)for(a=m=10;550>=m;a=m+=80)t.createInstance(n,r,a);return i.onStep=function(){return $("#debug").html("Mouse coords: "+this.scene.mouse_x+" / "+this.scene.mouse_y+"<br>Frameskip: "+this.engine.frameskip)},t.createInstance(i,0,0),e.start()})})}).call(this);

@ -0,0 +1,213 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="64"
height="64"
id="svg6013"
version="1.1"
inkscape:version="0.48.4 r9939"
sodipodi:docname="New document 19">
<defs
id="defs6015">
<linearGradient
id="linearGradient6627">
<stop
style="stop-color:#1b2882;stop-opacity:1;"
offset="0"
id="stop6629" />
<stop
style="stop-color:#0851e9;stop-opacity:1;"
offset="1"
id="stop6631" />
</linearGradient>
<linearGradient
id="linearGradient6617">
<stop
id="stop6619"
offset="0"
style="stop-color:#003ab6;stop-opacity:1;" />
<stop
id="stop6621"
offset="1"
style="stop-color:#2488ec;stop-opacity:1;" />
</linearGradient>
<linearGradient
id="linearGradient6577">
<stop
style="stop-color:#003ab6;stop-opacity:1;"
offset="0"
id="stop6579" />
<stop
style="stop-color:#2488ec;stop-opacity:1;"
offset="1"
id="stop6581" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient6577"
id="linearGradient6583"
x1="32"
y1="18.806769"
x2="50.185872"
y2="18.806769"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.7418123,0,0,1.487494,-23.737991,968.96191)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient6577"
id="linearGradient6591"
x1="13.814127"
y1="40.087818"
x2="32"
y2="40.087818"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.7418123,0,0,1.487494,-23.737991,968.96191)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient6577"
id="linearGradient6599"
x1="32"
y1="1024.1559"
x2="43.575737"
y2="1024.1559"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.7418123,0,0,1.487494,-23.737991,-501.22084)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient6577"
id="linearGradient6607"
x1="20.424263"
y1="1009.1486"
x2="32"
y2="1009.1486"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.7418123,0,0,1.487494,-23.737991,-501.22084)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient6627"
id="linearGradient6615"
x1="32"
y1="1009.1486"
x2="43.575737"
y2="1009.1486"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.7418123,0,0,1.487494,-23.737991,-501.22084)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient6627"
id="linearGradient6639"
x1="20.424263"
y1="1024.1559"
x2="32"
y2="1024.1559"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.7418123,0,0,1.487494,-23.737991,-501.22084)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient6627"
id="linearGradient6647"
x1="13.814127"
y1="18.806768"
x2="32"
y2="18.806768"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.7418123,0,0,1.487494,-23.737991,968.96191)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient6627"
id="linearGradient6655"
x1="32"
y1="40.087818"
x2="50.185871"
y2="40.087818"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.7418123,0,0,1.487494,-23.737991,968.96191)" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="8"
inkscape:cx="71.415194"
inkscape:cy="32.777992"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1920"
inkscape:window-height="1102"
inkscape:window-x="0"
inkscape:window-y="28"
inkscape:window-maximized="1" />
<metadata
id="metadata6018">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-988.36217)">
<path
style="fill:url(#linearGradient6655);fill-opacity:1;stroke:none"
d="m 32,1005.1652 31.676376,0 L 32,1052.0195 z"
id="path6559"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccc" />
<path
style="fill:url(#linearGradient6591);fill-opacity:1;stroke:none"
d="M 32,1052.0195 0.32362381,1005.1652 32,1005.1652"
id="path6023"
inkscape:connector-curvature="0" />
<path
style="fill:url(#linearGradient6583);fill-opacity:1;stroke:none"
d="m 32,1005.1689 31.676376,0 L 32,988.70487 l 0,0 0,0"
id="path6556"
inkscape:connector-curvature="0" />
<path
style="fill:url(#linearGradient6647);fill-opacity:1;stroke:none"
d="M 32,988.70487 0.32362381,1005.1689 32,1005.1689"
id="path6025"
inkscape:connector-curvature="0" />
<path
sodipodi:nodetypes="cccc"
inkscape:connector-curvature="0"
id="path6569"
d="m 32,1005.0967 20.162758,0 L 32,1039.3132 z"
style="fill:url(#linearGradient6599);fill-opacity:1;stroke:none" />
<path
id="path6571"
d="m 32,1039.3132 -20.162761,-34.2165 20.162761,0"
style="fill:url(#linearGradient6639);fill-opacity:1;stroke:none"
inkscape:connector-curvature="0" />
<path
id="path6573"
d="m 32,1005.0992 20.162758,0 L 32,994.66396 l 0,0 0,0"
style="fill:url(#linearGradient6615);fill-opacity:1;stroke:none"
inkscape:connector-curvature="0" />
<path
id="path6575"
d="m 32,994.66396 -20.162761,10.43524 20.162761,0"
style="fill:url(#linearGradient6607);fill-opacity:1;stroke:none"
inkscape:connector-curvature="0" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.7 KiB

@ -0,0 +1,279 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="64"
height="64"
id="svg6013"
version="1.1"
inkscape:version="0.48.4 r9939"
sodipodi:docname="blue.svg">
<defs
id="defs6015">
<linearGradient
id="linearGradient6716">
<stop
style="stop-color:#0851e9;stop-opacity:1;"
offset="0"
id="stop6720" />
<stop
style="stop-color:#1b2882;stop-opacity:1;"
offset="1"
id="stop6718" />
</linearGradient>
<linearGradient
id="linearGradient6708">
<stop
style="stop-color:#2488ec;stop-opacity:1;"
offset="0"
id="stop6712" />
<stop
style="stop-color:#003ab6;stop-opacity:1;"
offset="1"
id="stop6710" />
</linearGradient>
<linearGradient
id="linearGradient6700">
<stop
style="stop-color:#0851e9;stop-opacity:1;"
offset="0"
id="stop6704" />
<stop
style="stop-color:#1b2882;stop-opacity:1;"
offset="1"
id="stop6702" />
</linearGradient>
<linearGradient
id="linearGradient6692">
<stop
style="stop-color:#2488ec;stop-opacity:1;"
offset="0"
id="stop6696" />
<stop
style="stop-color:#003ab6;stop-opacity:1;"
offset="1"
id="stop6694" />
</linearGradient>
<linearGradient
id="linearGradient6684">
<stop
style="stop-color:#2488ec;stop-opacity:1;"
offset="0"
id="stop6688" />
<stop
style="stop-color:#003ab6;stop-opacity:1;"
offset="1"
id="stop6686" />
</linearGradient>
<linearGradient
id="linearGradient6676">
<stop
style="stop-color:#0851e9;stop-opacity:1;"
offset="0"
id="stop6680" />
<stop
style="stop-color:#1b2882;stop-opacity:1;"
offset="1"
id="stop6678" />
</linearGradient>
<linearGradient
id="linearGradient6627">
<stop
id="stop6631"
offset="0"
style="stop-color:#0851e9;stop-opacity:1;" />
<stop
id="stop6629"
offset="1"
style="stop-color:#1b2882;stop-opacity:1;" />
</linearGradient>
<linearGradient
id="linearGradient6617">
<stop
id="stop6619"
offset="0"
style="stop-color:#003ab6;stop-opacity:1;" />
<stop
id="stop6621"
offset="1"
style="stop-color:#2488ec;stop-opacity:1;" />
</linearGradient>
<linearGradient
id="linearGradient6577">
<stop
id="stop6581"
offset="0"
style="stop-color:#2488ec;stop-opacity:1;" />
<stop
id="stop6579"
offset="1"
style="stop-color:#003ab6;stop-opacity:1;" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient6684"
id="linearGradient6583"
x1="32"
y1="18.806769"
x2="50.185872"
y2="18.806769"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.7418123,0,0,1.487494,-23.737991,968.96191)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient6708"
id="linearGradient6591"
x1="13.814127"
y1="40.087818"
x2="32"
y2="40.087818"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.7418123,0,0,1.487494,-23.737991,968.96191)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient6577"
id="linearGradient6599"
x1="32"
y1="1024.1559"
x2="43.575737"
y2="1024.1559"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.7418123,0,0,1.487494,-23.737991,-501.22084)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient6692"
id="linearGradient6607"
x1="20.424263"
y1="1009.1486"
x2="32"
y2="1009.1486"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.7418123,0,0,1.487494,-23.737991,-501.22084)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient6700"
id="linearGradient6615"
x1="32"
y1="1009.1486"
x2="43.575737"
y2="1009.1486"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.7418123,0,0,1.487494,-23.737991,-501.22084)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient6716"
id="linearGradient6639"
x1="20.424263"
y1="1024.1559"
x2="32"
y2="1024.1559"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.7418123,0,0,1.487494,-23.737991,-501.22084)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient6676"
id="linearGradient6647"
x1="13.814127"
y1="18.806768"
x2="32"
y2="18.806768"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.7418123,0,0,1.487494,-23.737991,968.96191)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient6627"
id="linearGradient6655"
x1="32"
y1="40.087818"
x2="50.185871"
y2="40.087818"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.7418123,0,0,1.487494,-23.737991,968.96191)" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="8"
inkscape:cx="71.415194"
inkscape:cy="32.777992"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1920"
inkscape:window-height="1102"
inkscape:window-x="0"
inkscape:window-y="28"
inkscape:window-maximized="1" />
<metadata
id="metadata6018">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-988.36217)">
<path
style="fill:url(#linearGradient6655);fill-opacity:1;stroke:none"
d="m 32,1005.1652 31.676376,0 L 32,1052.0195 z"
id="path6559"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccc" />
<path
style="fill:url(#linearGradient6591);fill-opacity:1;stroke:none"
d="M 32,1052.0195 0.32362381,1005.1652 32,1005.1652"
id="path6023"
inkscape:connector-curvature="0" />
<path
style="fill:url(#linearGradient6583);fill-opacity:1;stroke:none"
d="m 32,1005.1689 31.676376,0 L 32,988.70487 l 0,0 0,0"
id="path6556"
inkscape:connector-curvature="0" />
<path
style="fill:url(#linearGradient6647);fill-opacity:1;stroke:none"
d="M 32,988.70487 0.32362381,1005.1689 32,1005.1689"
id="path6025"
inkscape:connector-curvature="0" />
<path
sodipodi:nodetypes="cccc"
inkscape:connector-curvature="0"
id="path6569"
d="m 32,1005.0967 20.162758,0 L 32,1039.3132 z"
style="fill:url(#linearGradient6599);fill-opacity:1;stroke:none" />
<path
id="path6571"
d="m 32,1039.3132 -20.162761,-34.2165 20.162761,0"
style="fill:url(#linearGradient6639);fill-opacity:1;stroke:none"
inkscape:connector-curvature="0" />
<path
id="path6573"
d="m 32,1005.0992 20.162758,0 L 32,994.66396 l 0,0 0,0"
style="fill:url(#linearGradient6615);fill-opacity:1;stroke:none"
inkscape:connector-curvature="0" />
<path
id="path6575"
d="m 32,994.66396 -20.162761,10.43524 20.162761,0"
style="fill:url(#linearGradient6607);fill-opacity:1;stroke:none"
inkscape:connector-curvature="0" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 8.4 KiB

@ -0,0 +1,287 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="93.419998"
height="93.419998"
id="svg6013"
version="1.1"
inkscape:version="0.48.4 r9939"
sodipodi:docname="blue_shimmer.svg">
<defs
id="defs6015">
<linearGradient
id="linearGradient6716">
<stop
style="stop-color:#0851e9;stop-opacity:1;"
offset="0"
id="stop6720" />
<stop
style="stop-color:#1b2882;stop-opacity:1;"
offset="1"
id="stop6718" />
</linearGradient>
<linearGradient
id="linearGradient6708">
<stop
style="stop-color:#2488ec;stop-opacity:1;"
offset="0"
id="stop6712" />
<stop
style="stop-color:#003ab6;stop-opacity:1;"
offset="1"
id="stop6710" />
</linearGradient>
<linearGradient
id="linearGradient6700">
<stop
style="stop-color:#0851e9;stop-opacity:1;"
offset="0"
id="stop6704" />
<stop
style="stop-color:#1b2882;stop-opacity:1;"
offset="1"
id="stop6702" />
</linearGradient>
<linearGradient
id="linearGradient6692">
<stop
style="stop-color:#2488ec;stop-opacity:1;"
offset="0"
id="stop6696" />
<stop
style="stop-color:#003ab6;stop-opacity:1;"
offset="1"
id="stop6694" />
</linearGradient>
<linearGradient
id="linearGradient6684">
<stop
style="stop-color:#2488ec;stop-opacity:1;"
offset="0"
id="stop6688" />
<stop
style="stop-color:#003ab6;stop-opacity:1;"
offset="1"
id="stop6686" />
</linearGradient>
<linearGradient
id="linearGradient6676">
<stop
style="stop-color:#0851e9;stop-opacity:1;"
offset="0"
id="stop6680" />
<stop
style="stop-color:#1b2882;stop-opacity:1;"
offset="1"
id="stop6678" />
</linearGradient>
<linearGradient
id="linearGradient6627">
<stop
id="stop6631"
offset="0"
style="stop-color:#0851e9;stop-opacity:1;" />
<stop
id="stop6629"
offset="1"
style="stop-color:#1b2882;stop-opacity:1;" />
</linearGradient>
<linearGradient
id="linearGradient6617">
<stop
id="stop6619"
offset="0"
style="stop-color:#003ab6;stop-opacity:1;" />
<stop
id="stop6621"
offset="1"
style="stop-color:#2488ec;stop-opacity:1;" />
</linearGradient>
<linearGradient
id="linearGradient6577">
<stop
id="stop6581"
offset="0"
style="stop-color:#2488ec;stop-opacity:1;" />
<stop
id="stop6579"
offset="1"
style="stop-color:#003ab6;stop-opacity:1;" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient6684"
id="linearGradient6583"
x1="32"
y1="18.806768"
x2="50.185871"
y2="18.806768"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.7418123,0,0,1.487494,-23.737991,968.96191)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient6708"
id="linearGradient6591"
x1="13.814127"
y1="40.087818"
x2="32"
y2="40.087818"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.7418123,0,0,1.487494,-23.737991,968.96191)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient6577"
id="linearGradient6599"
x1="32"
y1="1024.1559"
x2="43.575737"
y2="1024.1559"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.7418123,0,0,1.487494,-23.737991,-501.22084)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient6692"
id="linearGradient6607"
x1="20.424263"
y1="1009.1486"
x2="32"
y2="1009.1486"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.7418123,0,0,1.487494,-23.737991,-501.22084)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient6700"
id="linearGradient6615"
x1="32"
y1="1009.1486"
x2="43.575737"
y2="1009.1486"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.7418123,0,0,1.487494,-23.737991,-501.22084)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient6716"
id="linearGradient6639"
x1="20.424263"
y1="1024.1559"
x2="32"
y2="1024.1559"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.7418123,0,0,1.487494,-23.737991,-501.22084)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient6676"
id="linearGradient6647"
x1="13.814127"
y1="18.806768"
x2="32"
y2="18.806768"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.7418123,0,0,1.487494,-23.737991,968.96191)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient6627"
id="linearGradient6655"
x1="32"
y1="40.087818"
x2="50.185871"
y2="40.087818"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.7418123,0,0,1.487494,-23.737991,968.96191)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient6676"
id="linearGradient6770"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.7418123,0,0,1.487494,-23.737991,-19.40026)"
x1="13.814127"
y1="18.806768"
x2="32"
y2="18.806768" />
<filter
inkscape:collect="always"
id="filter6775"
x="-0.14666253"
width="1.2933251"
y="-0.13246012"
height="1.2649202"
color-interpolation-filters="sRGB">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="2.464268"
id="feGaussianBlur6777" />
</filter>
<filter
inkscape:collect="always"
id="filter6779"
x="-0.23388462"
width="1.4677691"
y="-0.2341155"
height="1.468231"
color-interpolation-filters="sRGB">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="6.1760156"
id="feGaussianBlur6781" />
</filter>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="5.6568543"
inkscape:cx="55.131664"
inkscape:cy="31.538345"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1920"
inkscape:window-height="1102"
inkscape:window-x="0"
inkscape:window-y="28"
inkscape:window-maximized="1"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0" />
<metadata
id="metadata6018">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(14.509937,-973.42085)">
<path
style="opacity:0.85900005;fill:#0079ff;fill-opacity:1;stroke:none;filter:url(#filter6779)"
d="m 32.200062,988.47461 -31.68749992,16.46879 31.68749992,46.8437 31.6875,-46.8437 -31.6875,-16.46879 z m 0,5.96875 20.15625,10.43754 -20.15625,34.1875 -20.15625,-34.1875 20.15625,-10.43754 z"
id="path6025"
inkscape:connector-curvature="0" />
<path
id="path6575"
style="opacity:0.30700001;fill:#004eff;fill-opacity:1;stroke:none;filter:url(#filter6775)"
d="m 32.200062,994.43265 -20.162761,10.43525 20.162761,0 m 0,0 20.162758,0 -20.162758,-10.43525 0,0 0,0 m 0,44.64925 -20.162761,-34.2165 20.162761,0 m 0,0 20.162758,0 -20.162758,34.2165 z"
inkscape:connector-curvature="0" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 8.6 KiB

@ -0,0 +1,81 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="82.002586"
height="82.010246"
id="svg6783"
version="1.1"
inkscape:version="0.48.4 r9939"
sodipodi:docname="cursor.svg">
<defs
id="defs6785">
<filter
inkscape:collect="always"
id="filter7432"
color-interpolation-filters="sRGB">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="0.85729526"
id="feGaussianBlur7434" />
</filter>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="7.9195959"
inkscape:cx="26.706834"
inkscape:cy="52.122953"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1920"
inkscape:window-height="1102"
inkscape:window-x="0"
inkscape:window-y="28"
inkscape:window-maximized="1"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0" />
<metadata
id="metadata6788">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(9.0012918,-979.35326)">
<path
id="path7310"
d="m -2.4014005,981.41846 c -2.5690494,0.25934 -4.5423826,2.44272 -4.5423826,5.08239 l 0,10.03771 3.9706141,0 0,-8.4177 c 0,-1.52045 1.2113359,-2.73179 2.73178253,-2.73179 l 8.41770187,0 0,-3.97061 -10.0377124,0 c -0.1759776,0 -0.3687335,-0.0173 -0.5400035,0 z m 58.2250855,0 0,3.97061 8.417701,0 c 1.520447,0 2.731783,1.21134 2.731783,2.73179 l 0,8.4177 3.970614,0 0,-10.03771 c 0,-2.81565 -2.266744,-5.08239 -5.082386,-5.08239 l -10.037712,0 z m -62.7674681,62.76744 0,10.0377 c 0,2.8157 2.2667442,5.0824 5.0823861,5.0824 l 10.0377124,0 0,-3.9706 -8.41770187,0 c -1.52044663,0 -2.73178253,-1.2113 -2.73178253,-2.7318 l 0,-8.4177 -3.9706141,0 z m 73.9169521,0 0,8.4177 c 0,1.5205 -1.211336,2.7318 -2.731783,2.7318 l -8.417701,0 0,3.9706 10.037712,0 c 2.815642,0 5.082386,-2.2667 5.082386,-5.0824 l 0,-10.0377 -3.970614,0 z"
style="opacity:0.32165605;fill:#0028ff;fill-opacity:1;stroke:none;filter:url(#filter7432)"
inkscape:connector-curvature="0" />
<path
style="opacity:0.85900005;fill:#0079ff;fill-opacity:1;stroke:none"
d="m -1.84375,-6.3125 c -2.5274048,0.2551392 -4.46875,2.403125 -4.46875,5 l 0,9.875 3.90625,0 0,-8.28125 c 0,-1.4958 1.1917,-2.6875 2.6875,-2.6875 l 8.28125,0 0,-3.90625 -9.875,0 c -0.173125,0 -0.3627563,-0.017009 -0.53125,0 z m 57.28125,0 0,3.90625 8.28125,0 c 1.4958,0 2.6875,1.1917 2.6875,2.6875 l 0,8.28125 3.90625,0 0,-9.875 c 0,-2.77 -2.23,-5 -5,-5 l -9.875,0 z m -61.75,61.75 0,9.875 c 0,2.77 2.23,5 5,5 l 9.875,0 0,-3.90625 -8.28125,0 c -1.4958,0 -2.6875,-1.1917 -2.6875,-2.6875 l 0,-8.28125 -3.90625,0 z m 72.71875,0 0,8.28125 c 0,1.4958 -1.1917,2.6875 -2.6875,2.6875 l -8.28125,0 0,3.90625 9.875,0 c 2.77,0 5,-2.23 5,-5 l 0,-9.875 -3.90625,0 z"
transform="translate(0,988.36218)"
id="rect6791"
inkscape:connector-curvature="0" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.8 KiB

@ -0,0 +1,349 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="64"
height="64"
id="svg2"
version="1.1"
inkscape:version="0.48.4 r9939"
sodipodi:docname="diamond.svg">
<defs
id="defs4">
<linearGradient
id="linearGradient3965">
<stop
id="stop3967"
offset="0"
style="stop-color:#6e6e6e;stop-opacity:1;" />
<stop
id="stop3969"
offset="1"
style="stop-color:#dfdfdf;stop-opacity:1;" />
</linearGradient>
<linearGradient
id="linearGradient3912">
<stop
style="stop-color:#959595;stop-opacity:1;"
offset="0"
id="stop3914" />
<stop
style="stop-color:#f6f6f6;stop-opacity:1;"
offset="1"
id="stop3916" />
</linearGradient>
<linearGradient
id="linearGradient3900">
<stop
style="stop-color:#b0b0b0;stop-opacity:1;"
offset="0"
id="stop3902" />
<stop
style="stop-color:#d5d5d5;stop-opacity:1;"
offset="1"
id="stop3904" />
</linearGradient>
<linearGradient
id="linearGradient3892">
<stop
style="stop-color:#c6c6c6;stop-opacity:1;"
offset="0"
id="stop3894" />
<stop
style="stop-color:#e3e3e3;stop-opacity:1;"
offset="1"
id="stop3896" />
</linearGradient>
<linearGradient
id="linearGradient3884">
<stop
style="stop-color:#d5d5d5;stop-opacity:1;"
offset="0"
id="stop3886" />
<stop
style="stop-color:#f6f6f6;stop-opacity:1;"
offset="1"
id="stop3888" />
</linearGradient>
<linearGradient
id="linearGradient3876">
<stop
style="stop-color:#888888;stop-opacity:1;"
offset="0"
id="stop3878" />
<stop
style="stop-color:#d0d0d0;stop-opacity:1;"
offset="1"
id="stop3880" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3876"
id="linearGradient3882"
x1="7.8346815"
y1="14.376256"
x2="33.076497"
y2="14.376256"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3884"
id="linearGradient3890"
x1="6.423687"
y1="14.376256"
x2="34.487492"
y2="14.376256"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3892"
id="linearGradient3898"
x1="6.5624604"
y1="14.376256"
x2="34.348718"
y2="14.376256"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3912"
id="linearGradient3918"
x1="43.6875"
y1="8.953125"
x2="66.375"
y2="8.953125"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3912"
id="linearGradient3926"
x1="60.4375"
y1="32.078125"
x2="69.1875"
y2="32.078125"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3912"
id="linearGradient3934"
x1="43.78125"
y1="55.109375"
x2="66.3125"
y2="55.109375"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3912"
id="linearGradient3936"
x1="17.6875"
y1="64.828125"
x2="46.28125"
y2="64.828125"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3912"
id="linearGradient3938"
x1="-2.3125"
y1="55.109375"
x2="20.1875"
y2="55.109375"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3965"
id="linearGradient3940"
x1="-5.1875"
y1="32.015625"
x2="3.5625"
y2="32.015625"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3912"
id="linearGradient3942"
x1="-2.34375"
y1="8.921875"
x2="20.25"
y2="8.921875"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3912"
id="linearGradient3944"
x1="17.75"
y1="-0.828125"
x2="46.1875"
y2="-0.828125"
gradientUnits="userSpaceOnUse" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#000000"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:zoom="8"
inkscape:cx="24.807647"
inkscape:cy="29.688085"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:snap-global="false"
inkscape:window-width="1920"
inkscape:window-height="1102"
inkscape:window-x="0"
inkscape:window-y="28"
inkscape:window-maximized="1">
<inkscape:grid
type="axonomgrid"
id="grid2985"
units="mm"
empspacing="5"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true"
originx="1.5mm"
gridanglez="30"
spacingy="1mm" />
</sodipodi:namedview>
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-988.36218)">
<g
id="g3847"
transform="matrix(0.85711544,0,0,0.85711544,4.5723061,145.794)"
style="fill:none">
<path
id="path3845"
d="M 56.587204,42.417389 66.25,46.34375 C 68.104505,41.926547 69.125,37.090921 69.125,32 c 0,-5.031989 -0.998476,-9.811516 -2.8125,-14.1875 l -9.538024,4.136393 6.079553,10.066627 -6.171771,10.244967 z"
style="fill:url(#linearGradient3926);fill-opacity:1;stroke:none"
inkscape:connector-curvature="0"
transform="translate(0,988.36218)"
sodipodi:nodetypes="ccsccccc" />
<path
transform="translate(0,988.36218)"
id="path3841"
d="M 42.011366,56.683388 46.21875,66.28125 C 55.228514,62.535229 62.473949,55.33784 66.25,46.34375 l -9.655529,-3.939171 -2.784079,11.383864 z"
style="fill:url(#linearGradient3934);fill-opacity:1;stroke:none"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccc" />
<path
transform="translate(0,988.36218)"
id="path3837"
d="M -2.28125,17.71875 7.3975812,21.617517 10.233506,10.211557 22.053146,7.2878373 17.8125,-2.28125 c -9.0435732,3.7515633 -16.3211942,10.9673576 -20.09375,20 z"
style="fill:url(#linearGradient3942);fill-opacity:1;stroke:none"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccc" />
<path
transform="translate(0,988.36218)"
id="path3835"
d="M -2.25,46.3125 7.3526661,42.057344 7.2439397,41.968803 1.211504,31.978051 7.3808589,21.665733 7.4839819,21.629013 -2.28125,17.71875 C -4.1190691,22.119046 -5.125,26.9333 -5.125,32 c 0,5.080433 1.0277284,9.902612 2.875,14.3125 z"
style="fill:url(#linearGradient3940);fill-opacity:1.0;stroke:none"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccsc" />
<path
transform="translate(0,988.36218)"
id="path3833"
d="M 21.656492,56.575074 10.211557,53.766494 7.2697938,42.027956 -2.25,46.3125 c 3.7690881,8.997733 10.9938676,16.215755 20,19.96875 z"
style="fill:url(#linearGradient3938);fill-opacity:1;stroke:none"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccc" />
<path
transform="translate(0,988.36218)"
id="path3831"
d="M 21.598084,56.58047 17.75,66.28125 c 4.39296,1.830615 9.193789,2.84375 14.25,2.84375 5.045723,0 9.833135,-1.020328 14.21875,-2.84375 l -4.245957,-9.685078 -0.16355,0.09021 L 32,62.810445 21.829209,56.607815 z"
style="fill:url(#linearGradient3936);fill-opacity:1;stroke:none"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccscccccc" />
<path
transform="translate(0,988.36218)"
id="path3813"
d="M 46.125,-2.3125 C 41.763756,-4.1122099 37.011013,-5.125 32,-5.125 c -5.035235,0 -9.809238,1.0275071 -14.1875,2.84375 L 21.957912,7.2456166 32,1.211504 42.421916,7.3735829 z"
style="fill:url(#linearGradient3944);fill-opacity:1;stroke:none"
inkscape:connector-curvature="0"
sodipodi:nodetypes="csccccc" />
<path
transform="translate(0,988.36218)"
id="path3790"
d="m 46.125,-2.3125 -3.721314,9.7250576 0.25847,0.053385 11.104338,2.7456144 2.918233,11.698922 0.04948,0.05859 L 66.3125,17.8125 C 62.541859,8.7165519 55.228257,1.4440479 46.125,-2.3125 z"
style="fill:url(#linearGradient3918);fill-opacity:1;stroke:none"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccc" />
</g>
<g
id="g3798"
transform="matrix(0.71188475,0,0,0.71188475,10.469688,294.51761)">
<path
transform="matrix(3.1896315,0,0,3.1896315,-35.001692,973.7547)"
d="m 20.537579,1.8360243 3.844595,3.2331978 4.998673,0.4977264 0.432323,5.0047555 3.182651,3.886542 -3.233198,3.844594 -0.497726,4.998674 -5.004755,0.432323 -3.886542,3.182651 -3.844595,-3.233198 -4.998674,-0.497727 -0.432323,-5.004755 -3.1826504,-3.886542 3.2331974,-3.844594 0.497727,-4.9986742 5.004755,-0.432323 z"
inkscape:randomized="0"
inkscape:rounded="0"
inkscape:flatsided="false"
sodipodi:arg2="-1.1715592"
sodipodi:arg1="-1.5642583"
sodipodi:r2="10.101433"
sodipodi:r1="12.5405"
sodipodi:cy="14.376256"
sodipodi:cx="20.455589"
sodipodi:sides="8"
id="path3796"
style="fill:url(#linearGradient3890);fill-opacity:1;stroke:none"
sodipodi:type="star" />
<path
transform="matrix(2.4959218,0,0,2.4959218,-20.811454,983.72765)"
d="m 20.515484,6.8463457 4.969153,-4.3608663 0.337755,6.6086777 6.59732,0.4301236 -4.434212,4.9118693 4.360866,4.969153 -6.608678,0.337755 -0.430123,6.59732 -4.91187,-4.434212 -4.969153,4.360867 -0.337755,-6.608678 -6.59732,-0.430124 4.434212,-4.911869 L 8.5648127,9.3472086 15.17349,9.0094536 15.603614,2.4121337 z"
inkscape:randomized="0"
inkscape:rounded="0"
inkscape:flatsided="false"
sodipodi:arg2="-1.1706745"
sodipodi:arg1="-1.5628423"
sodipodi:r2="12.910534"
sodipodi:r1="7.5301485"
sodipodi:cy="14.376256"
sodipodi:cx="20.455589"
sodipodi:sides="8"
id="path3794"
style="fill:url(#linearGradient3898);fill-opacity:1;stroke:none"
sodipodi:type="star" />
<path
sodipodi:type="star"
style="fill:url(#linearGradient3882);fill-opacity:1;stroke:none"
id="path3792"
sodipodi:sides="8"
sodipodi:cx="20.455589"
sodipodi:cy="14.376256"
sodipodi:r1="12.517542"
sodipodi:r2="11.660198"
sodipodi:arg1="-1.5658343"
sodipodi:arg2="-1.1731352"
inkscape:flatsided="true"
inkscape:rounded="0"
inkscape:randomized="0"
d="m 20.517701,1.8588682 8.832938,3.7101779 3.622338,8.8693219 -3.710178,8.832938 -8.869322,3.622338 L 11.56054,23.183466 7.9382015,14.314144 11.648379,5.4812063 z"
transform="matrix(1.4992405,0,0,1.4992405,-0.42375043,998.05627)" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 12 KiB

@ -0,0 +1,416 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="64"
height="64"
id="svg2"
version="1.1"
inkscape:version="0.48.4 r9939"
sodipodi:docname="diamond_inverted.svg">
<defs
id="defs4">
<linearGradient
id="linearGradient4077">
<stop
style="stop-color:#f6f6f6;stop-opacity:1;"
offset="0"
id="stop4081" />
<stop
style="stop-color:#959595;stop-opacity:1;"
offset="1"
id="stop4079" />
</linearGradient>
<linearGradient
id="linearGradient4069">
<stop
style="stop-color:#f6f6f6;stop-opacity:1;"
offset="0"
id="stop4073" />
<stop
style="stop-color:#959595;stop-opacity:1;"
offset="1"
id="stop4071" />
</linearGradient>
<linearGradient
id="linearGradient4061">
<stop
style="stop-color:#f6f6f6;stop-opacity:1;"
offset="0"
id="stop4065" />
<stop
style="stop-color:#959595;stop-opacity:1;"
offset="1"
id="stop4063" />
</linearGradient>
<linearGradient
id="linearGradient4053">
<stop
style="stop-color:#f6f6f6;stop-opacity:1;"
offset="0"
id="stop4057" />
<stop
style="stop-color:#959595;stop-opacity:1;"
offset="1"
id="stop4055" />
</linearGradient>
<linearGradient
id="linearGradient4045">
<stop
style="stop-color:#f6f6f6;stop-opacity:1;"
offset="0"
id="stop4049" />
<stop
style="stop-color:#959595;stop-opacity:1;"
offset="1"
id="stop4047" />
</linearGradient>
<linearGradient
id="linearGradient4037">
<stop
style="stop-color:#f6f6f6;stop-opacity:1;"
offset="0"
id="stop4041" />
<stop
style="stop-color:#959595;stop-opacity:1;"
offset="1"
id="stop4039" />
</linearGradient>
<linearGradient
id="linearGradient3965">
<stop
style="stop-color:#dfdfdf;stop-opacity:1;"
offset="0"
id="stop3969" />
<stop
style="stop-color:#6e6e6e;stop-opacity:1;"
offset="1"
id="stop3967" />
</linearGradient>
<linearGradient
id="linearGradient3912">
<stop
id="stop3916"
offset="0"
style="stop-color:#f6f6f6;stop-opacity:1;" />
<stop
id="stop3914"
offset="1"
style="stop-color:#959595;stop-opacity:1;" />
</linearGradient>
<linearGradient
id="linearGradient3900">
<stop
style="stop-color:#b0b0b0;stop-opacity:1;"
offset="0"
id="stop3902" />
<stop
style="stop-color:#d5d5d5;stop-opacity:1;"
offset="1"
id="stop3904" />
</linearGradient>
<linearGradient
id="linearGradient3892">
<stop
id="stop3896"
offset="0"
style="stop-color:#e3e3e3;stop-opacity:1;" />
<stop
id="stop3894"
offset="1"
style="stop-color:#c6c6c6;stop-opacity:1;" />
</linearGradient>
<linearGradient
id="linearGradient3884">
<stop
id="stop3888"
offset="0"
style="stop-color:#f6f6f6;stop-opacity:1;" />
<stop
id="stop3886"
offset="1"
style="stop-color:#d5d5d5;stop-opacity:1;" />
</linearGradient>
<linearGradient
id="linearGradient3876">
<stop
id="stop3880"
offset="0"
style="stop-color:#d0d0d0;stop-opacity:1;" />
<stop
id="stop3878"
offset="1"
style="stop-color:#888888;stop-opacity:1;" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3876"
id="linearGradient3882"
x1="7.8346815"
y1="14.376256"
x2="33.076497"
y2="14.376256"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3884"
id="linearGradient3890"
x1="6.423687"
y1="14.376256"
x2="34.487492"
y2="14.376256"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3892"
id="linearGradient3898"
x1="6.5624604"
y1="14.376256"
x2="34.348718"
y2="14.376256"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient4045"
id="linearGradient3918"
x1="43.6875"
y1="8.953125"
x2="66.375"
y2="8.953125"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3965"
id="linearGradient3926"
x1="60.4375"
y1="32.078125"
x2="69.1875"
y2="32.078125"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient4061"
id="linearGradient3934"
x1="43.78125"
y1="55.109375"
x2="66.3125"
y2="55.109375"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient4069"
id="linearGradient3936"
x1="17.6875"
y1="64.828125"
x2="46.28125"
y2="64.828125"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient4077"
id="linearGradient3938"
x1="-2.3125"
y1="55.109375"
x2="20.1875"
y2="55.109375"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3912"
id="linearGradient3940"
x1="-5.1875"
y1="32.015625"
x2="3.5625"
y2="32.015625"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3912"
id="linearGradient3942"
x1="-2.34375"
y1="8.921875"
x2="20.25"
y2="8.921875"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient4037"
id="linearGradient3944"
x1="17.75"
y1="-0.828125"
x2="46.1875"
y2="-0.828125"
gradientUnits="userSpaceOnUse"
spreadMethod="pad" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#000000"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:zoom="8"
inkscape:cx="24.807647"
inkscape:cy="29.688085"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:snap-global="false"
inkscape:window-width="1920"
inkscape:window-height="1102"
inkscape:window-x="0"
inkscape:window-y="28"
inkscape:window-maximized="1">
<inkscape:grid
type="axonomgrid"
id="grid2985"
units="mm"
empspacing="5"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true"
originx="1.5mm"
gridanglez="30"
spacingy="1mm" />
</sodipodi:namedview>
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-988.36218)">
<g
id="g3847"
transform="matrix(0.85711544,0,0,0.85711544,4.5723061,145.794)"
style="fill:none">
<path
id="path3845"
d="M 56.587204,42.417389 66.25,46.34375 C 68.104505,41.926547 69.125,37.090921 69.125,32 c 0,-5.031989 -0.998476,-9.811516 -2.8125,-14.1875 l -9.538024,4.136393 6.079553,10.066627 -6.171771,10.244967 z"
style="fill:url(#linearGradient3926);fill-opacity:1.0;stroke:none"
inkscape:connector-curvature="0"
transform="translate(0,988.36218)"
sodipodi:nodetypes="ccsccccc" />
<path
transform="translate(0,988.36218)"
id="path3841"
d="M 42.011366,56.683388 46.21875,66.28125 C 55.228514,62.535229 62.473949,55.33784 66.25,46.34375 l -9.655529,-3.939171 -2.784079,11.383864 z"
style="fill:url(#linearGradient3934);fill-opacity:1;stroke:none"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccc" />
<path
transform="translate(0,988.36218)"
id="path3837"
d="M -2.28125,17.71875 7.3975812,21.617517 10.233506,10.211557 22.053146,7.2878373 17.8125,-2.28125 c -9.0435732,3.7515633 -16.3211942,10.9673576 -20.09375,20 z"
style="fill:url(#linearGradient3942);fill-opacity:1;stroke:none"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccc" />
<path
transform="translate(0,988.36218)"
id="path3835"
d="M -2.25,46.3125 7.3526661,42.057344 7.2439397,41.968803 1.211504,31.978051 7.3808589,21.665733 7.4839819,21.629013 -2.28125,17.71875 C -4.1190691,22.119046 -5.125,26.9333 -5.125,32 c 0,5.080433 1.0277284,9.902612 2.875,14.3125 z"
style="fill:url(#linearGradient3940);fill-opacity:1.0;stroke:none"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccsc" />
<path
transform="translate(0,988.36218)"
id="path3833"
d="M 21.656492,56.575074 10.211557,53.766494 7.2697938,42.027956 -2.25,46.3125 c 3.7690881,8.997733 10.9938676,16.215755 20,19.96875 z"
style="fill:url(#linearGradient3938);fill-opacity:1;stroke:none"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccc" />
<path
transform="translate(0,988.36218)"
id="path3831"
d="M 21.598084,56.58047 17.75,66.28125 c 4.39296,1.830615 9.193789,2.84375 14.25,2.84375 5.045723,0 9.833135,-1.020328 14.21875,-2.84375 l -4.245957,-9.685078 -0.16355,0.09021 L 32,62.810445 21.829209,56.607815 z"
style="fill:url(#linearGradient3936);fill-opacity:1;stroke:none"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccscccccc" />
<path
transform="translate(0,988.36218)"
id="path3813"
d="M 46.125,-2.3125 C 41.763756,-4.1122099 37.011013,-5.125 32,-5.125 c -5.035235,0 -9.809238,1.0275071 -14.1875,2.84375 L 21.957912,7.2456166 32,1.211504 42.421916,7.3735829 z"
style="fill:url(#linearGradient3944);fill-opacity:1.0;stroke:none"
inkscape:connector-curvature="0"
sodipodi:nodetypes="csccccc" />
<path
transform="translate(0,988.36218)"
id="path3790"
d="m 46.125,-2.3125 -3.721314,9.7250576 0.25847,0.053385 11.104338,2.7456144 2.918233,11.698922 0.04948,0.05859 L 66.3125,17.8125 C 62.541859,8.7165519 55.228257,1.4440479 46.125,-2.3125 z"
style="fill:url(#linearGradient3918);fill-opacity:1;stroke:none"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccc" />
</g>
<g
id="g3798"
transform="matrix(0.71188475,0,0,0.71188475,10.469688,294.51761)">
<path
transform="matrix(3.1896315,0,0,3.1896315,-35.001692,973.7547)"
d="m 20.537579,1.8360243 3.844595,3.2331978 4.998673,0.4977264 0.432323,5.0047555 3.182651,3.886542 -3.233198,3.844594 -0.497726,4.998674 -5.004755,0.432323 -3.886542,3.182651 -3.844595,-3.233198 -4.998674,-0.497727 -0.432323,-5.004755 -3.1826504,-3.886542 3.2331974,-3.844594 0.497727,-4.9986742 5.004755,-0.432323 z"
inkscape:randomized="0"
inkscape:rounded="0"
inkscape:flatsided="false"
sodipodi:arg2="-1.1715592"
sodipodi:arg1="-1.5642583"
sodipodi:r2="10.101433"
sodipodi:r1="12.5405"
sodipodi:cy="14.376256"
sodipodi:cx="20.455589"
sodipodi:sides="8"
id="path3796"
style="fill:url(#linearGradient3890);fill-opacity:1;stroke:none"
sodipodi:type="star" />
<path
transform="matrix(2.4959218,0,0,2.4959218,-20.811454,983.72765)"
d="m 20.515484,6.8463457 4.969153,-4.3608663 0.337755,6.6086777 6.59732,0.4301236 -4.434212,4.9118693 4.360866,4.969153 -6.608678,0.337755 -0.430123,6.59732 -4.91187,-4.434212 -4.969153,4.360867 -0.337755,-6.608678 -6.59732,-0.430124 4.434212,-4.911869 L 8.5648127,9.3472086 15.17349,9.0094536 15.603614,2.4121337 z"
inkscape:randomized="0"
inkscape:rounded="0"
inkscape:flatsided="false"
sodipodi:arg2="-1.1706745"
sodipodi:arg1="-1.5628423"
sodipodi:r2="12.910534"
sodipodi:r1="7.5301485"
sodipodi:cy="14.376256"
sodipodi:cx="20.455589"
sodipodi:sides="8"
id="path3794"
style="fill:url(#linearGradient3898);fill-opacity:1;stroke:none"
sodipodi:type="star" />
<path
sodipodi:type="star"
style="fill:url(#linearGradient3882);fill-opacity:1;stroke:none"
id="path3792"
sodipodi:sides="8"
sodipodi:cx="20.455589"
sodipodi:cy="14.376256"
sodipodi:r1="12.517542"
sodipodi:r2="11.660198"
sodipodi:arg1="-1.5658343"
sodipodi:arg2="-1.1731352"
inkscape:flatsided="true"
inkscape:rounded="0"
inkscape:randomized="0"
d="m 20.517701,1.8588682 8.832938,3.7101779 3.622338,8.8693219 -3.710178,8.832938 -8.869322,3.622338 L 11.56054,23.183466 7.9382015,14.314144 11.648379,5.4812063 z"
transform="matrix(1.4992405,0,0,1.4992405,-0.42375043,998.05627)" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 14 KiB

@ -0,0 +1,347 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="93.419922"
height="93.419922"
id="svg2"
version="1.1"
inkscape:version="0.48.4 r9939"
sodipodi:docname="diamond_shimmer.svg">
<defs
id="defs4">
<linearGradient
id="linearGradient4077">
<stop
style="stop-color:#f6f6f6;stop-opacity:1;"
offset="0"
id="stop4081" />
<stop
style="stop-color:#959595;stop-opacity:1;"
offset="1"
id="stop4079" />
</linearGradient>
<linearGradient
id="linearGradient4069">
<stop
style="stop-color:#f6f6f6;stop-opacity:1;"
offset="0"
id="stop4073" />
<stop
style="stop-color:#959595;stop-opacity:1;"
offset="1"
id="stop4071" />
</linearGradient>
<linearGradient
id="linearGradient4061">
<stop
style="stop-color:#f6f6f6;stop-opacity:1;"
offset="0"
id="stop4065" />
<stop
style="stop-color:#959595;stop-opacity:1;"
offset="1"
id="stop4063" />
</linearGradient>
<linearGradient
id="linearGradient4053">
<stop
style="stop-color:#f6f6f6;stop-opacity:1;"
offset="0"
id="stop4057" />
<stop
style="stop-color:#959595;stop-opacity:1;"
offset="1"
id="stop4055" />
</linearGradient>
<linearGradient
id="linearGradient4045">
<stop
style="stop-color:#f6f6f6;stop-opacity:1;"
offset="0"
id="stop4049" />
<stop
style="stop-color:#959595;stop-opacity:1;"
offset="1"
id="stop4047" />
</linearGradient>
<linearGradient
id="linearGradient4037">
<stop
style="stop-color:#f6f6f6;stop-opacity:1;"
offset="0"
id="stop4041" />
<stop
style="stop-color:#959595;stop-opacity:1;"
offset="1"
id="stop4039" />
</linearGradient>
<linearGradient
id="linearGradient3965">
<stop
style="stop-color:#dfdfdf;stop-opacity:1;"
offset="0"
id="stop3969" />
<stop
style="stop-color:#6e6e6e;stop-opacity:1;"
offset="1"
id="stop3967" />
</linearGradient>
<linearGradient
id="linearGradient3912">
<stop
id="stop3916"
offset="0"
style="stop-color:#f6f6f6;stop-opacity:1;" />
<stop
id="stop3914"
offset="1"
style="stop-color:#959595;stop-opacity:1;" />
</linearGradient>
<linearGradient
id="linearGradient3900">
<stop
style="stop-color:#b0b0b0;stop-opacity:1;"
offset="0"
id="stop3902" />
<stop
style="stop-color:#d5d5d5;stop-opacity:1;"
offset="1"
id="stop3904" />
</linearGradient>
<linearGradient
id="linearGradient3892">
<stop
id="stop3896"
offset="0"
style="stop-color:#e3e3e3;stop-opacity:1;" />
<stop
id="stop3894"
offset="1"
style="stop-color:#c6c6c6;stop-opacity:1;" />
</linearGradient>
<linearGradient
id="linearGradient3884">
<stop
id="stop3888"
offset="0"
style="stop-color:#f6f6f6;stop-opacity:1;" />
<stop
id="stop3886"
offset="1"
style="stop-color:#d5d5d5;stop-opacity:1;" />
</linearGradient>
<linearGradient
id="linearGradient3876">
<stop
id="stop3880"
offset="0"
style="stop-color:#d0d0d0;stop-opacity:1;" />
<stop
id="stop3878"
offset="1"
style="stop-color:#888888;stop-opacity:1;" />
</linearGradient>
<filter
inkscape:collect="always"
id="filter4307"
x="-0.13962264"
width="1.2792453"
y="-0.13962264"
height="1.2792453"
color-interpolation-filters="sRGB">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="4.6539389"
id="feGaussianBlur4309" />
</filter>
<filter
inkscape:collect="always"
id="filter4358"
x="-0.23396225"
width="1.4679245"
y="-0.23396225"
height="1.4679245"
color-interpolation-filters="sRGB">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="7.2382075"
id="feGaussianBlur4360" />
</filter>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#000000"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:zoom="8"
inkscape:cx="39.517607"
inkscape:cy="44.398045"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:snap-global="false"
inkscape:window-width="1920"
inkscape:window-height="1102"
inkscape:window-x="0"
inkscape:window-y="28"
inkscape:window-maximized="1"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0">
<inkscape:grid
type="axonomgrid"
id="grid2985"
units="mm"
empspacing="5"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true"
originx="5.6514778mm"
gridanglez="30"
spacingy="1mm"
originy="4.1514775mm" />
</sodipodi:namedview>
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(14.709961,-973.65222)">
<g
style="opacity:0.85942676;fill:#ffffff;fill-opacity:1;filter:url(#filter4358)"
transform="matrix(0.85711544,0,0,0.85711544,4.5723059,145.794)"
id="g4221">
<path
sodipodi:nodetypes="ccsccccc"
transform="translate(0,988.36218)"
inkscape:connector-curvature="0"
style="fill:#ffffff;fill-opacity:1;stroke:none"
d="M 56.587204,42.417389 66.25,46.34375 C 68.104505,41.926547 69.125,37.090921 69.125,32 c 0,-5.031989 -0.998476,-9.811516 -2.8125,-14.1875 l -9.538024,4.136393 6.079553,10.066627 -6.171771,10.244967 z"
id="path4223" />
<path
sodipodi:nodetypes="cccccc"
inkscape:connector-curvature="0"
style="fill:#ffffff;fill-opacity:1;stroke:none"
d="M 42.011366,56.683388 46.21875,66.28125 C 55.228514,62.535229 62.473949,55.33784 66.25,46.34375 l -9.655529,-3.939171 -2.784079,11.383864 z"
id="path4225"
transform="translate(0,988.36218)" />
<path
sodipodi:nodetypes="cccccc"
inkscape:connector-curvature="0"
style="fill:#ffffff;fill-opacity:1;stroke:none"
d="M -2.28125,17.71875 7.3975812,21.617517 10.233506,10.211557 22.053146,7.2878373 17.8125,-2.28125 c -9.0435732,3.7515633 -16.3211942,10.9673576 -20.09375,20 z"
id="path4227"
transform="translate(0,988.36218)" />
<path
sodipodi:nodetypes="cccccccsc"
inkscape:connector-curvature="0"
style="fill:#ffffff;fill-opacity:1;stroke:none"
d="M -2.25,46.3125 7.3526661,42.057344 7.2439397,41.968803 1.211504,31.978051 7.3808589,21.665733 7.4839819,21.629013 -2.28125,17.71875 C -4.1190691,22.119046 -5.125,26.9333 -5.125,32 c 0,5.080433 1.0277284,9.902612 2.875,14.3125 z"
id="path4229"
transform="translate(0,988.36218)" />
<path
sodipodi:nodetypes="cccccc"
inkscape:connector-curvature="0"
style="fill:#ffffff;fill-opacity:1;stroke:none"
d="M 21.656492,56.575074 10.211557,53.766494 7.2697938,42.027956 -2.25,46.3125 c 3.7690881,8.997733 10.9938676,16.215755 20,19.96875 z"
id="path4231"
transform="translate(0,988.36218)" />
<path
sodipodi:nodetypes="ccscccccc"
inkscape:connector-curvature="0"
style="fill:#ffffff;fill-opacity:1;stroke:none"
d="M 21.598084,56.58047 17.75,66.28125 c 4.39296,1.830615 9.193789,2.84375 14.25,2.84375 5.045723,0 9.833135,-1.020328 14.21875,-2.84375 l -4.245957,-9.685078 -0.16355,0.09021 L 32,62.810445 21.829209,56.607815 z"
id="path4233"
transform="translate(0,988.36218)" />
<path
sodipodi:nodetypes="csccccc"
inkscape:connector-curvature="0"
style="fill:#ffffff;fill-opacity:1;stroke:none"
d="M 46.125,-2.3125 C 41.763756,-4.1122099 37.011013,-5.125 32,-5.125 c -5.035235,0 -9.809238,1.0275071 -14.1875,2.84375 L 21.957912,7.2456166 32,1.211504 42.421916,7.3735829 z"
id="path4235"
transform="translate(0,988.36218)" />
<path
sodipodi:nodetypes="cccccccc"
inkscape:connector-curvature="0"
style="fill:#ffffff;fill-opacity:1;stroke:none"
d="m 46.125,-2.3125 -3.721314,9.7250576 0.25847,0.053385 11.104338,2.7456144 2.918233,11.698922 0.04948,0.05859 L 66.3125,17.8125 C 62.541859,8.7165519 55.228257,1.4440479 46.125,-2.3125 z"
id="path4237"
transform="translate(0,988.36218)" />
</g>
<g
transform="matrix(0.71188475,0,0,0.71188475,10.469686,294.51761)"
id="g4279"
style="opacity:0.30707009;fill:#dddddd;fill-opacity:1;filter:url(#filter4307)">
<path
sodipodi:type="star"
style="fill:#dddddd;fill-opacity:1;stroke:none"
id="path4281"
sodipodi:sides="8"
sodipodi:cx="20.455589"
sodipodi:cy="14.376256"
sodipodi:r1="12.5405"
sodipodi:r2="10.101433"
sodipodi:arg1="-1.5642583"
sodipodi:arg2="-1.1715592"
inkscape:flatsided="false"
inkscape:rounded="0"
inkscape:randomized="0"
d="m 20.537579,1.8360243 3.844595,3.2331978 4.998673,0.4977264 0.432323,5.0047555 3.182651,3.886542 -3.233198,3.844594 -0.497726,4.998674 -5.004755,0.432323 -3.886542,3.182651 -3.844595,-3.233198 -4.998674,-0.497727 -0.432323,-5.004755 -3.1826504,-3.886542 3.2331974,-3.844594 0.497727,-4.9986742 5.004755,-0.432323 z"
transform="matrix(3.1896315,0,0,3.1896315,-35.001692,973.7547)" />
<path
sodipodi:type="star"
style="fill:#dddddd;fill-opacity:1;stroke:none"
id="path4283"
sodipodi:sides="8"
sodipodi:cx="20.455589"
sodipodi:cy="14.376256"
sodipodi:r1="7.5301485"
sodipodi:r2="12.910534"
sodipodi:arg1="-1.5628423"
sodipodi:arg2="-1.1706745"
inkscape:flatsided="false"
inkscape:rounded="0"
inkscape:randomized="0"
d="m 20.515484,6.8463457 4.969153,-4.3608663 0.337755,6.6086777 6.59732,0.4301236 -4.434212,4.9118693 4.360866,4.969153 -6.608678,0.337755 -0.430123,6.59732 -4.91187,-4.434212 -4.969153,4.360867 -0.337755,-6.608678 -6.59732,-0.430124 4.434212,-4.911869 L 8.5648127,9.3472086 15.17349,9.0094536 15.603614,2.4121337 z"
transform="matrix(2.4959218,0,0,2.4959218,-20.811454,983.72765)" />
<path
transform="matrix(1.4992405,0,0,1.4992405,-0.42375043,998.05627)"
d="m 20.517701,1.8588682 8.832938,3.7101779 3.622338,8.8693219 -3.710178,8.832938 -8.869322,3.622338 L 11.56054,23.183466 7.9382015,14.314144 11.648379,5.4812063 z"
inkscape:randomized="0"
inkscape:rounded="0"
inkscape:flatsided="true"
sodipodi:arg2="-1.1731352"
sodipodi:arg1="-1.5658343"
sodipodi:r2="11.660198"
sodipodi:r1="12.517542"
sodipodi:cy="14.376256"
sodipodi:cx="20.455589"
sodipodi:sides="8"
id="path4285"
style="fill:#dddddd;fill-opacity:1;stroke:none"
sodipodi:type="star" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 12 KiB

@ -0,0 +1,144 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="64"
height="64"
id="svg4574"
version="1.1"
inkscape:version="0.48.4 r9939"
sodipodi:docname="New document 12">
<defs
id="defs4576">
<linearGradient
id="linearGradient5225">
<stop
style="stop-color:#b3bc00;stop-opacity:1;"
offset="0"
id="stop5227" />
<stop
style="stop-color:#fffd00;stop-opacity:1;"
offset="1"
id="stop5229" />
</linearGradient>
<linearGradient
id="linearGradient5217">
<stop
style="stop-color:#f6ff4b;stop-opacity:1;"
offset="0"
id="stop5219" />
<stop
style="stop-color:#cbcd00;stop-opacity:1;"
offset="1"
id="stop5221" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5217"
id="linearGradient5223"
x1="22.04138"
y1="35.629803"
x2="42.422916"
y2="35.629803"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.5605175,0,0,1.808848,-18.298823,961.24711)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5225"
id="linearGradient5231"
x1="32.140044"
y1="1021.0099"
x2="52.619882"
y2="1021.0099"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.5605175,0,0,1.808848,-18.298823,-826.54977)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5225"
id="linearGradient5239"
x1="11.826907"
y1="32.703693"
x2="32.293694"
y2="32.703693"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.5605175,0,0,1.808848,-18.298823,961.24711)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5225"
id="linearGradient5247"
x1="11.832388"
y1="1035.6812"
x2="52.665997"
y2="1035.6812"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.5605175,0,0,1.808848,-18.298823,-826.54977)" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="8"
inkscape:cx="13.589299"
inkscape:cy="29.841469"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1920"
inkscape:window-height="1102"
inkscape:window-x="0"
inkscape:window-y="28"
inkscape:window-maximized="1" />
<metadata
id="metadata4579">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-988.36218)">
<path
id="path5171"
style="fill:url(#linearGradient5239);fill-opacity:1;stroke:none"
d="m 0.25480298,1052.2292 31.74371302,-63.65222 -2.2e-4,21.26162 -15.776695,31.6758 -15.91358282,10.6601 z"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccc" />
<path
id="path5168"
style="fill:url(#linearGradient5247);fill-opacity:1;stroke:none"
d="m 63.745196,1052.2298 -0.07183,-0.1194 -15.911308,-10.6607 0.04328,0.1123 -31.610678,0 0.02693,-0.047 -15.91357816,10.6601 z"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccc" />
<path
id="path5163"
style="fill:url(#linearGradient5231);fill-opacity:1;stroke:none"
d="m 32.000025,1009.8291 0,0 15.76205,31.62 15.91131,10.66 -31.673358,-63.6146 0,0 -0.0015,0.0814 -2.22e-4,21.26152 z"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccccc" />
<path
id="path5092"
style="fill:url(#linearGradient5223);fill-opacity:1;stroke:none"
d="m 32,1009.8298 0,0 0,0 15.717734,31.5563 0.08761,0.1755 -31.610677,0 0.03327,-0.066 z"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.7 KiB

@ -0,0 +1,166 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="64"
height="64"
id="svg4574"
version="1.1"
inkscape:version="0.48.4 r9939"
sodipodi:docname="yellow.svg">
<defs
id="defs4576">
<linearGradient
id="linearGradient5276">
<stop
style="stop-color:#fffd00;stop-opacity:1;"
offset="0"
id="stop5280" />
<stop
style="stop-color:#b3bc00;stop-opacity:1;"
offset="1"
id="stop5278" />
</linearGradient>
<linearGradient
id="linearGradient5268">
<stop
style="stop-color:#fffd00;stop-opacity:1;"
offset="0"
id="stop5272" />
<stop
style="stop-color:#b3bc00;stop-opacity:1;"
offset="1"
id="stop5270" />
</linearGradient>
<linearGradient
id="linearGradient5225">
<stop
id="stop5229"
offset="0"
style="stop-color:#fffd00;stop-opacity:1;" />
<stop
id="stop5227"
offset="1"
style="stop-color:#b3bc00;stop-opacity:1;" />
</linearGradient>
<linearGradient
id="linearGradient5217">
<stop
id="stop5221"
offset="0"
style="stop-color:#cbcd00;stop-opacity:1;" />
<stop
id="stop5219"
offset="1"
style="stop-color:#f6ff4b;stop-opacity:1;" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5217"
id="linearGradient5223"
x1="22.04138"
y1="35.629803"
x2="42.422916"
y2="35.629803"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.5605175,0,0,1.808848,-18.298823,961.24711)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5276"
id="linearGradient5231"
x1="32.140044"
y1="1021.0099"
x2="52.619882"
y2="1021.0099"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.5605175,0,0,1.808848,-18.298823,-826.54977)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5268"
id="linearGradient5239"
x1="11.826907"
y1="32.703693"
x2="32.293694"
y2="32.703693"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.5605175,0,0,1.808848,-18.298823,961.24711)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5225"
id="linearGradient5247"
x1="11.832388"
y1="1035.6812"
x2="52.665997"
y2="1035.6812"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.5605175,0,0,1.808848,-18.298823,-826.54977)" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="8"
inkscape:cx="13.589299"
inkscape:cy="29.841469"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1920"
inkscape:window-height="1102"
inkscape:window-x="0"
inkscape:window-y="28"
inkscape:window-maximized="1" />
<metadata
id="metadata4579">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-988.36218)">
<path
id="path5171"
style="fill:url(#linearGradient5239);fill-opacity:1;stroke:none"
d="m 0.25480298,1052.2292 31.74371302,-63.65222 -2.2e-4,21.26162 -15.776695,31.6758 -15.91358282,10.6601 z"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccc" />
<path
id="path5168"
style="fill:url(#linearGradient5247);fill-opacity:1;stroke:none"
d="m 63.745196,1052.2298 -0.07183,-0.1194 -15.911308,-10.6607 0.04328,0.1123 -31.610678,0 0.02693,-0.047 -15.91357816,10.6601 z"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccc" />
<path
id="path5163"
style="fill:url(#linearGradient5231);fill-opacity:1;stroke:none"
d="m 32.000025,1009.8291 0,0 15.76205,31.62 15.91131,10.66 -31.673358,-63.6146 0,0 -0.0015,0.0814 -2.22e-4,21.26152 z"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccccc" />
<path
id="path5092"
style="fill:url(#linearGradient5223);fill-opacity:1;stroke:none"
d="m 32,1009.8298 0,0 0,0 15.717734,31.5563 0.08761,0.1755 -31.610677,0 0.03327,-0.066 z"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.2 KiB

@ -0,0 +1,188 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="93.419998"
height="93.419998"
id="svg4574"
version="1.1"
inkscape:version="0.48.4 r9939"
sodipodi:docname="yellow_shimmer.svg">
<defs
id="defs4576">
<linearGradient
id="linearGradient5276">
<stop
style="stop-color:#fffd00;stop-opacity:1;"
offset="0"
id="stop5280" />
<stop
style="stop-color:#b3bc00;stop-opacity:1;"
offset="1"
id="stop5278" />
</linearGradient>
<linearGradient
id="linearGradient5268">
<stop
style="stop-color:#fffd00;stop-opacity:1;"
offset="0"
id="stop5272" />
<stop
style="stop-color:#b3bc00;stop-opacity:1;"
offset="1"
id="stop5270" />
</linearGradient>
<linearGradient
id="linearGradient5225">
<stop
id="stop5229"
offset="0"
style="stop-color:#fffd00;stop-opacity:1;" />
<stop
id="stop5227"
offset="1"
style="stop-color:#b3bc00;stop-opacity:1;" />
</linearGradient>
<linearGradient
id="linearGradient5217">
<stop
id="stop5221"
offset="0"
style="stop-color:#cbcd00;stop-opacity:1;" />
<stop
id="stop5219"
offset="1"
style="stop-color:#f6ff4b;stop-opacity:1;" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5276"
id="linearGradient5231"
x1="32.140045"
y1="1021.0099"
x2="52.619881"
y2="1021.0099"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.5605175,0,0,1.808848,-18.298823,-826.54977)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5268"
id="linearGradient5239"
x1="11.826907"
y1="32.703693"
x2="32.293694"
y2="32.703693"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.5605175,0,0,1.808848,-18.298823,961.24711)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5225"
id="linearGradient5247"
x1="11.832388"
y1="1035.6812"
x2="52.665997"
y2="1035.6812"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.5605175,0,0,1.808848,-18.298823,-826.54977)" />
<filter
inkscape:collect="always"
id="filter6000"
x="-0.13946669"
width="1.2789334"
y="-0.13893433"
height="1.2778687"
color-interpolation-filters="sRGB">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="1.8369318"
id="feGaussianBlur6002" />
</filter>
<filter
inkscape:collect="always"
id="filter6009"
x="-0.23445131"
width="1.4689026"
y="-0.23355041"
height="1.4671009"
color-interpolation-filters="sRGB">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="6.2022525"
id="feGaussianBlur6011" />
</filter>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#000000"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:zoom="8"
inkscape:cx="13.589299"
inkscape:cy="54.841469"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1920"
inkscape:window-height="1102"
inkscape:window-x="0"
inkscape:window-y="28"
inkscape:window-maximized="1"
fit-margin-bottom="-0.1" />
<metadata
id="metadata4579">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-958.94218)">
<g
id="g6004"
style="opacity:0.85900005;fill:#efff33;fill-opacity:1;filter:url(#filter6009)"
transform="translate(14.71,-14.709971)">
<path
sodipodi:nodetypes="cccccc"
inkscape:connector-curvature="0"
d="m 0.25480298,1052.2292 31.74371302,-63.65222 -2.2e-4,21.26162 -15.776695,31.6758 -15.91358282,10.6601 z"
style="fill:#efff33;fill-opacity:1;stroke:none"
id="path5171" />
<path
sodipodi:nodetypes="cccccccc"
inkscape:connector-curvature="0"
d="m 63.745196,1052.2298 -0.07183,-0.1194 -15.911308,-10.6607 0.04328,0.1123 -31.610678,0 0.02693,-0.047 -15.91357816,10.6601 z"
style="fill:#efff33;fill-opacity:1;stroke:none"
id="path5168" />
<path
sodipodi:nodetypes="ccccccccc"
inkscape:connector-curvature="0"
d="m 32.000025,1009.8291 0,0 15.76205,31.62 15.91131,10.66 -31.673358,-63.6146 0,0 -0.0015,0.0814 -2.22e-4,21.2615 z"
style="fill:#efff33;fill-opacity:1;stroke:none"
id="path5163" />
</g>
<path
id="path5092"
style="opacity:0.30700001;fill:#efff33;fill-opacity:1;stroke:none;filter:url(#filter6000)"
d="m 46.71,995.1198 0,0 0,0 15.717734,31.5563 0.08761,0.1755 -31.610677,0 0.03327,-0.066 z"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.8 KiB

@ -0,0 +1,149 @@
var gulp = require('gulp');
var gutil = require('gulp-util');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var coffee = require('gulp-coffee');
var addsrc = require('gulp-add-src');
var cache = require('gulp-cached');
var remember = require('gulp-remember');
var header = require('gulp-header');
var footer = require('gulp-footer');
var plumber = require('gulp-plumber');
/* Configuration */
var experiments = ["drag", "easing"]
/* Engine build tasks */
engine = {
source: "radium/*.coffee",
external: ["external/jquery-2.1.1.js", "external/preloadjs-0.4.1.min.js", "external/soundjs-0.5.2.min.js"],
target: {
path: "compiled",
name: "radium.js",
minName: "radium.min.js"
}
}
gulp.task('dev-engine', function() {
return gulp.src(engine.source)
.pipe(plumber())
.pipe(cache("engine-coffee"))
.pipe(coffee({bare: true}).on('error', gutil.log)).on('data', gutil.log)
.pipe(remember("engine-coffee"))
.pipe(concat("radium.coffee.js"))
.pipe(header('(function () {'))
.pipe(footer('; window.ResourceManager = ResourceManager; window.Engine = Engine; })();'))
.pipe(addsrc(engine.external))
.pipe(concat("radium.concat.js"))
.pipe(rename(engine.target.name))
.pipe(gulp.dest(engine.target.path));
});
gulp.task("prod-engine", ["dev-engine"], function(){
return gulp.src(engine.target.path + "/" + engine.target.name)
.pipe(uglify())
.pipe(rename(engine.target.minName))
.pipe(gulp.dest(engine.target.path));
});
/* Experiment build tasks */
var experiment_settings = {};
for(var i in experiments)
{
var name = experiments[i];
experiment_settings[name] = {
source: "experiments/" + name + "/*.coffee",
external: "",
target: {
path: "experiments",
name: name + ".js",
minName: name + ".min.js"
}
}
gulp.task('dev-' + name, function() {
return gulp.src(experiment_settings[name].source)
.pipe(plumber())
.pipe(cache(name))
.pipe(coffee({bare: true}).on('error', gutil.log)).on('data', gutil.log)
.pipe(remember(name))
.pipe(concat(name + ".coffee.js"))
.pipe(header('(function () {'))
.pipe(footer('})();'))
.pipe(concat(name + ".concat.js"))
.pipe(rename(experiment_settings[name].target.name))
.pipe(gulp.dest(experiment_settings[name].target.path));
});
gulp.task("prod-" + name, ["dev-" + name], function(){
return gulp.src(experiment_settings[name].target.path + "/" + experiment_settings[name].target.name)
.pipe(uglify())
.pipe(rename(experiment_settings[name].target.minName))
.pipe(gulp.dest(experiment_settings[name].target.path));
});
}
/* Sample game build tasks */
gemswap = {
source: "gemswap/*.coffee",
external: "",
target: {
path: "gemswap",
name: "gemswap.js",
minName: "gemswap.min.js"
}
}
gulp.task('dev-gemswap', function() {
return gulp.src(gemswap.source)
.pipe(plumber())
.pipe(cache("gemswap-coffee"))
.pipe(coffee({bare: true}).on('error', gutil.log)).on('data', gutil.log)
.pipe(remember("gemswap-coffee"))
.pipe(concat("gemswap.coffee.js"))
.pipe(header('(function () {'))
.pipe(footer('})();'))
.pipe(addsrc(gemswap.external))
.pipe(concat("gemswap.concat.js"))
.pipe(rename(gemswap.target.name))
.pipe(gulp.dest(gemswap.target.path));
});
gulp.task("prod-gemswap", ["dev-gemswap"], function(){
return gulp.src(gemswap.target.path + "/" + gemswap.target.name)
.pipe(uglify())
.pipe(rename(gemswap.target.minName))
.pipe(gulp.dest(gemswap.target.path));
});
/* Watcher */
gulp.task('watch', function () {
var targets = {
"gemswap": gemswap,
"engine": engine
}
for (var attrname in experiment_settings) { targets[attrname] = experiment_settings[attrname]; }
for(var tname in targets)
{
var watcher = gulp.watch(targets[tname].source, ['dev-' + tname]);
watcher.on('change', function (event) {
if (event.type === 'deleted')
{
delete cache.caches[tname + '-coffee'][event.path];
remember.forget(tname + '-coffee', event.path);
}
});
/* Initial build */
gulp.start("dev-" + tname);
}
});
gulp.task("dev", ["dev-engine", "dev-gemswap"]);
gulp.task("prod", ["prod-engine", "prod-gemswap"]);
gulp.task("default", ["prod"]);

@ -1,240 +0,0 @@
if(RadiumEngine !== undefined)
{
/*Class*/ RadiumEngine.prototype.IsometricMap = function(canvas)
{
this.tile_width = 32;
this.tile_height = 64;
this.width = 6;
this.height = 6;
this.mouse_tile = undefined;
this.mouse_over = false;
this.mouse_in = false;
this.fill_screen = false;
this.canvas = canvas
this.context = canvas.getContext("2d");
$(this.canvas).bind('mouseenter', {'self': this}, function(event){
self.mouse_over = true;
});
$(this.canvas).bind('mouseleave', {'self': this}, function(event){
self.mouse_over = false;
});
$(this.canvas).bind('mousemove', {'self': this}, function(event){
self = event.data.self;
var rect = self.canvas.getBoundingClientRect();
var root = document.documentElement;
var mouse_x = event.clientX - rect.top - root.scrollTop;
var mouse_y = event.clientY - rect.left - root.scrollLeft;
var coords = event.data.self.TileFromPosition(mouse_x, mouse_y);
self.mouse_tile = coords;
if(coords.x >= 0 && coords.x < self.width && coords.y >= 0 && coords.y < self.height)
{
self.mouse_in = true;
}
else
{
self.mouse_in = false;
}
self.Redraw();
});
var Configure = this.Configure = function(tile_width, tile_height)
{
this.tile_width = tile_width;
this.tile_height = tile_height;
}
this.SetFill = function(enabled)
{
if(enabled === true)
{
$(this.canvas).css({
'position': "absolute",
'left': "0px",
'top': "0px"
});
$('body').css({
'overflow': "hidden"
});
}
this.fill_screen = enabled;
this.UpdateSize();
}
this.UpdateSize = function()
{
if(this.fill_screen === false)
{
this.canvas.width = $(this.canvas).width();
this.canvas.height = $(this.canvas).height();
}
else
{
this.canvas.width = window.innerWidth;
this.canvas.height = window.innerHeight;
$(this.canvas).css({
'width': window.innerWidth + "px",
'height': window.innerHeight + "px"
});
}
}
var Redraw = this.Redraw = function()
{
this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);
for(var i = 0; i < this.height; i++)
{
for(var r = 0; r < this.width; r++)
{
this.DrawTile(r, i);
/*pos = this.GetTilePosition(r, i);
this.context.fillRect(pos.x, pos.y, 1, 1);*/
}
}
}
this.DrawTile = function(tile_x, tile_y)
{
var pos_x = tile_x * this.tile_width;
var pos_y = tile_y * this.tile_height;
var t1 = this.GetTileOrigin(tile_x, tile_y);
var t2 = t1.Add(new RadiumEngine.Point(this.tile_width / 2, this.tile_height / 2));
var t3 = t1.Add(new RadiumEngine.Point(0, this.tile_height));
var t4 = t1.Add(new RadiumEngine.Point(0 - (this.tile_width / 2), this.tile_height / 2));
this.context.beginPath();
this.context.moveTo(t1.x, t1.y);
this.context.lineTo(t2.x, t2.y);
this.context.lineTo(t3.x, t3.y);
this.context.lineTo(t4.x, t4.y);
this.context.lineTo(t1.x, t1.y);
switch(tile_y)
{
case 0:
this.context.lineWidth = 1;
break;
case 1:
this.context.lineWidth = 2;
break;
case 2:
this.context.lineWidth = 3;
break;
case 3:
this.context.lineWidth = 4;
break;
case 4:
this.context.lineWidth = 5;
break;
case 5:
this.context.lineWidth = 6;
break;
}
switch(tile_x)
{
case 0:
this.context.strokeStyle = "blue";
break;
case 1:
this.context.strokeStyle = "purple";
break;
case 2:
this.context.strokeStyle = "green";
break;
case 3:
this.context.strokeStyle = "red";
break;
case 4:
this.context.strokeStyle = "maroon";
break;
case 5:
this.context.strokeStyle = "black";
break;
}
if(this.mouse_tile !== undefined && tile_x == this.mouse_tile.x && tile_y == this.mouse_tile.y)
{
this.context.fillStyle = "#D9FFB4";
this.context.fill();
}
this.context.stroke();
}
this.GetBasePoint = function()
{
return new RadiumEngine.Point((this.width * this.tile_width) / 2, 0);
}
this.GetTileOrigin = function(tile_x, tile_y)
{
/* Determine base point (0,0) of the isometric diamond. */
base_point = this.GetBasePoint();
/* Determine offset for determining starting point for the current row (tile_y coordinate). */
row_offset = new RadiumEngine.Point(0 - ((this.tile_width / 2) * tile_y), (this.tile_height / 2) * tile_y);
/* Determine specific offset of the specified tile_x coordinate on the tile_y row. */
tile_offset = new RadiumEngine.Point((this.tile_width / 2) * tile_x, (this.tile_height / 2) * tile_x);
/* Return the sum of the above to determine the actual tile position on the canvas. */
return base_point.Add(row_offset, tile_offset);
}
this.GetTilePosition = function(tile_x, tile_y)
{
origin = this.GetTileOrigin(tile_x, tile_y);
return origin.Add(new RadiumEngine.Point(0 - (this.tile_width / 2), 0));
}
this.GetRangePosition = function(start, size)
{
x = this.GetTilePosition(start.x, start.y + size.y - 1).x;
y = this.GetTilePosition(start.x, start.y).y;
return new RadiumEngine.Point(x, y);
}
this.TileFromPosition = function(x, y)
{
p = new RadiumEngine.Point(x, y);
a = self.GetBasePoint();
b = a.Add(new RadiumEngine.Point(0 - (this.tile_width / 2), this.tile_height / 2));
c = a.Add(new RadiumEngine.Point(this.tile_width / 2, this.tile_height / 2));
/* Compute vectors. */
v0 = c.Subtract(a);
v1 = b.Subtract(a);
v2 = p.Subtract(a);
/* Compute dot products. */
dot00 = RadiumEngine.dot_product([v0.x, v0.y], [v0.x, v0.y]);
dot01 = RadiumEngine.dot_product([v0.x, v0.y], [v1.x, v1.y]);
dot02 = RadiumEngine.dot_product([v0.x, v0.y], [v2.x, v2.y]);
dot11 = RadiumEngine.dot_product([v1.x, v1.y], [v1.x, v1.y]);
dot12 = RadiumEngine.dot_product([v1.x, v1.y], [v2.x, v2.y]);
/* Compute tile. */
inv_denom = 1 / (dot00 * dot11 - dot01 * dot01);
tile_x = (dot11 * dot02 - dot01 * dot12) * inv_denom;
tile_y = (dot00 * dot12 - dot01 * dot02) * inv_denom;
return new RadiumEngine.Point(Math.floor(tile_x), Math.floor(tile_y));
}
}
}

@ -0,0 +1,20 @@
{
"name": "radium",
"description": "A game engine.",
"version": "0.0.1",
"devDependencies": {
"gulp": "3.6.x",
"gulp-add-src": "0.1.x",
"gulp-coffee": "1.4",
"gulp-concat": "2.2.x",
"gulp-rename": "1.2.x",
"gulp-uglify": "0.3.x",
"gulp-util": "2.2.x",
"gulp-cached": "0.0.x",
"gulp-remember": "0.2.x",
"gulp-header": "1.0.x",
"gulp-footer": "1.0.x",
"gulp-plumber": "0.6.x",
"coffee-script": "1.7.x"
}
}

@ -0,0 +1,149 @@
window.pass = undefined # This will give us Python-like noop calls
class Engine
constructor: (@resource_manager) ->
@canvases = {}
@fps = 45
@last_frameskip_collection = Math.floor(Date.now())
@frameskip = 0
@current_frameskip = 0
@current_frame = 0
@scenes = {}
@objects = {}
@sounds = {}
@sprites = {}
@tilesets = {}
@named_timers = {}
@unnamed_timers = []
# The following is to make the engine object available in library methods
# FUTURE: Iterate over easing methods and create an engine-bound version
# in the local engine object, overriding the prototype methods?
@ease.engine = this
@draw.engine = this
@resource_manager.engine = this
addCanvas: (canvas, label = "") =>
@canvases[label] = util.unpackElement(canvas)
createSurface: (label) =>
@canvases[label] = document.createElement("canvas")
getSurface: (label) =>
if typeof label == "string"
return @canvases[label]?.getContext("2d")
else if label.tagName == "CANVAS"
return label.getContext("2d")
else
return label
updateCanvasSize: (canvas, w, h) =>
canvas.width = w
canvas.height = h
canvas.style.width = "#{w}px"
canvas.style.height = "#{h}px"
start: () =>
@loop()
loop: () =>
@iteration()
iteration: () =>
# Calculation of next frame and frameskip collection check
frame_interval = (1000 / @fps)
current_frame = Date.now()
next_frame = current_frame + frame_interval
@current_frame += 1
if Math.floor(current_frame) > @last_frameskip_collection
@frameskip = @current_frameskip
@current_frameskip = 0
@last_frameskip_collection = Math.floor(current_frame)
# Actual iteration code...
# Then process registered timers.
@updateTimers()
# Now we run the scene-specific code.
scene.iteration() for name, scene of @scenes when scene.active
# Frameskip check and triggering next iteration
if Date.now() < next_frame
setTimeout(@iteration, (next_frame - Date.now()))
else
# Frameskip!
overtime = Date.now() - next_frame
skipped_frames = Math.floor(overtime / frame_interval)
@current_frameskip += skipped_frames
@current_frame += skipped_frames
@skipTimers(skipped_frames)
belated_timeout = overtime % frame_interval
setTimeout(@iteration, belated_timeout)
updateTimers: =>
for timer in @unnamed_timers.concat (val for key, val of @named_timers)
timer.step()
# Clean up finished timers
@unnamed_timers = @unnamed_timers.filter (obj) -> not obj.finished
for timer_name, timer of @named_timers
if timer.finished
delete @named_timers[timer_name]
skipTimers: (frames) =>
for timer in @unnamed_timers.concat (val for key, val of @named_timers)
timer.skip(frames)
setInitialScene: (scene) =>
@initial_scene = scene
setPreloadScene: (scene) =>
@preload_scene = scene
switchPreloadScene: =>
@preload_scene.addTargetSurface(@canvases[""])
switchInitialScene: =>
@preload_scene?.removeTargetSurface(@canvases[""])
@initial_scene.addTargetSurface(@canvases[""])
createScene: (name) =>
scene = new Scene(this, name)
@initial_scene ?= scene
@scenes[name] = scene
createObject: (name) =>
@objects[name] = new Object(this, name)
createSound: (name, sound) =>
@sounds[name] = new Sound(this, name, @resource_manager.getSound(sound))
createSprite: (name, image) =>
@sprites[name] = new Sprite(this, name, @resource_manager.getImage(image))
createSprites: (sprites) =>
for name, image of sprites
@createSprite(name, image)
createTileset: (name, image, tile_width, tile_height) =>
@tilesets[name] = new Tileset(this, name, @resource_manager.getImage(image), tile_width, tile_height)
getScene: (name) =>
if typeof name == "string" then @scenes[name] else name
getObject: (name) =>
if typeof name == "string" then @objects[name] else name
getSound: (name) =>
if typeof name == "string" then @sounds[name] else name
getSprite: (name) =>
if typeof name == "string" then @sprites[name] else name
getTileset: (name) =>
if typeof name == "string" then @tilesets[name] else name

@ -0,0 +1,113 @@
Engine::draw =
_startPath: (surface, options) ->
surface = @engine.getSurface(surface)
if not options._is_text ? false
surface.beginPath()
return surface
_finishPath: (surface, options) ->
if options.stroke ? true
surface.lineWidth = options.lineWidth ? options.pen?.lineWidth ? 1
surface.strokeStyle = options.lineColor ? options.pen?.lineColor ? "black"
if options._is_text ? false
surface.strokeText(options.text, options.x, options.y)
else
surface.stroke()
if options.fill ? false
surface.fillStyle = options.fillColor ? options.pen?.fillColor ? "white"
if options._is_text ? false
surface.fillText(options.text, options.x, options.y)
else
surface.fill()
_getTextWidth: (surface, text, options) ->
@_applyTextContext(surface, options)
width = surface.measureText(text).width
surface.restore()
return width
_applyTextContext: (surface, options) ->
font_family = options.font ? "sans-serif"
font_size = options.size ? 16
font_weight = options.weight ? "normal"
font_style = options.style ? "normal"
scale = options.scale ? 1
surface.save()
surface.font = "#{font_weight} #{font_style} #{font_size}px '#{font_family}'"
surface.globalAlpha = options.alpha ? 1
surface.scale(scale, scale)
line: (x1, y1, x2, y2, options = {}, surface = "") ->
surface = @_startPath(surface, options)
surface.moveTo(x1, y1)
surface.lineTo(x2, y2)
@_finishPath(surface, options)
rectangle: (x1, y1, x2, y2, options = {}, surface = "") ->
surface = @_startPath(surface, options)
surface.rect(x1, y1, x2 - x1, y2 - y1)
@_finishPath(surface, options)
boxEllipse: (x1, y1, x2, y2, options = {}, surface = "") ->
x = (x1 + x2) / 2;
y = (y1 + y2) / 2;
rx = (x2 - x1) / 2;
ry = (y2 - y1) / 2;
@radiusEllipse(x, y, rx, ry, options, surface)
radiusEllipse: (x, y, rx, ry, options = {}, surface = "") ->
surface = @_startPath(surface, options)
step = options.step ? 0.1
if rx == ry
surface.arc(x, y, rx, 0, 2 * Math.PI, false)
else
surface.moveTo(x + rx, y)
for i in [0 .. (Math.PI * 2 + step)]
surface.lineTo(x + (Math.cos(i) * rx), y + (Math.sin(i) * ry))
@_finishPath(surface, options)
boxPolygon: (x1, y1, x2, y2, sides, options = {}, surface = "") ->
pass # TODO
radiusPolygon: (x, y, r, sides, options = {}, surface = "") ->
pass # TODO
text: (x, y, text, options = {}, surface = "") ->
# Defaults
options.alignment ?= "left"
options.scale ?= 1
options._is_text = true
options.text = text
options.y = y
# Text needs different default color settings from other shapes...
options.fill ?= true
options.fillColor ?= "black"
options.stroke ?= false
# X coordinate will be calculated depending on alignment
if alignment == "left"
options.x = x
else
text_width = @_getTextWidth(text, options)
if alignment == "center"
options.x = x - ((text_width / 2) * scale * scale)
else if alignment == "right"
options.x = x - text_width # FIXME: Possibly broken wrt scale?
@_startPath(surface, options)
@_finishPath(surface, options)
# This is to avoid scale from affecting anything else
surface.restore()

@ -0,0 +1,287 @@
Engine::ease =
_calculateElasticValues: (duration, amplitude, period, change, inout = false) ->
if !period?
if inout
period = duration * (0.3 * 1.5)
else
period = duration * 0.3
if !amplitude? or amplitude < Math.abs(change)
amplitude = change
overshoot = period / 4
else
overshoot = period / (2 * Math.PI) * Math.asin(change / amplitude)
return [amplitude, period, change, overshoot]
backIn: (start, end, duration, next = null, infinite = false , invert_repeat = false, overshoot = 1.70158) ->
return new Ease(this.engine, "backIn", infinite, start, end, @engine.current_frame, duration, invert_repeat, next, overshoot)
backOut: (start, end, duration, next = null, infinite = false , invert_repeat = false, overshoot = 1.70158) ->
return new Ease(this.engine, "backOut", infinite, start, end, @engine.current_frame, duration, invert_repeat, next, overshoot)
backInOut: (start, end, duration, next = null, infinite = false , invert_repeat = false, overshoot = 1.70158) ->
return new Ease(this.engine, "backInOut", infinite, start, end, @engine.current_frame, duration, invert_repeat, next, overshoot)
bounceOut: (start, end, duration, next = null, infinite = false , invert_repeat = false) ->
return new Ease(this.engine, "bounceOut", infinite, start, end, @engine.current_frame, duration, invert_repeat, next)
bounceIn: (start, end, duration, next = null, infinite = false , invert_repeat = false) ->
return new Ease(this.engine, "bounceIn", infinite, start, end, @engine.current_frame, duration, invert_repeat, next)
bounceInOut: (start, end, duration, next = null, infinite = false , invert_repeat = false) ->
return new Ease(this.engine, "bounceInOut", infinite, start, end, @engine.current_frame, duration, invert_repeat, next)
circOut: (start, end, duration, next = null, infinite = false , invert_repeat = false) ->
return new Ease(this.engine, "circOut", infinite, start, end, @engine.current_frame, duration, invert_repeat, next)
circIn: (start, end, duration, next = null, infinite = false , invert_repeat = false) ->
return new Ease(this.engine, "circIn", infinite, start, end, @engine.current_frame, duration, invert_repeat, next)
circInOut: (start, end, duration, next = null, infinite = false , invert_repeat = false) ->
return new Ease(this.engine, "circInOut", infinite, start, end, @engine.current_frame, duration, invert_repeat, next)
cubicOut: (start, end, duration, next = null, infinite = false , invert_repeat = false) ->
return new Ease(this.engine, "cubicOut", infinite, start, end, @engine.current_frame, duration, invert_repeat, next)
cubicIn: (start, end, duration, next = null, infinite = false , invert_repeat = false) ->
return new Ease(this.engine, "cubicIn", infinite, start, end, @engine.current_frame, duration, invert_repeat, next)
cubicInOut: (start, end, duration, next = null, infinite = false , invert_repeat = false) ->
return new Ease(this.engine, "cubicInOut", infinite, start, end, @engine.current_frame, duration, invert_repeat, next)
elasticOut: (start, end, duration, next = null, infinite = false , invert_repeat = false, amplitude = null, period = null) ->
[amplitude, period, change, overshoot] = @_calculateElasticValues(duration, amplitude, period, end - start)
end = start + change
return new Ease(this.engine, "elasticOut", infinite, start, end, @engine.current_frame, duration, invert_repeat, next, amplitude, period, overshoot)
elasticIn: (start, end, duration, next = null, infinite = false , invert_repeat = false, amplitude = null, period = null) ->
[amplitude, period, change, overshoot] = @_calculateElasticValues(duration, amplitude, period, end - start)
end = start + change
return new Ease(this.engine, "elasticIn", infinite, start, end, @engine.current_frame, duration, invert_repeat, next, amplitude, period, overshoot)
elasticInOut: (start, end, duration, next = null, infinite = false , invert_repeat = false, amplitude = null, period = null) ->
[amplitude, period, change, overshoot] = @_calculateElasticValues(duration, amplitude, period, end - start, true)
end = start + change
return new Ease(this.engine, "elasticInOut", infinite, start, end, @engine.current_frame, duration, invert_repeat, next, amplitude, period, overshoot)
expoOut: (start, end, duration, next = null, infinite = false , invert_repeat = false) ->
return new Ease(this.engine, "expoOut", infinite, start, end, @engine.current_frame, duration, invert_repeat, next)
expoIn: (start, end, duration, next = null, infinite = false , invert_repeat = false) ->
return new Ease(this.engine, "expoIn", infinite, start, end, @engine.current_frame, duration, invert_repeat, next)
expoInOut: (start, end, duration, next = null, infinite = false , invert_repeat = false) ->
return new Ease(this.engine, "expoInOut", infinite, start, end, @engine.current_frame, duration, invert_repeat, next)
linearNone: (start, end, duration, next = null, infinite = false , invert_repeat = false) ->
return new Ease(this.engine, "linearNone", infinite, start, end, @engine.current_frame, duration, invert_repeat, next)
linearOut: (start, end, duration, next = null, infinite = false , invert_repeat = false) ->
return new Ease(this.engine, "linearNone", infinite, start, end, @engine.current_frame, duration, invert_repeat, next)
linearIn: (start, end, duration, next = null, infinite = false , invert_repeat = false) ->
return new Ease(this.engine, "linearNone", infinite, start, end, @engine.current_frame, duration, invert_repeat, next)
linearInOut: (start, end, duration, next = null, infinite = false , invert_repeat = false) ->
return new Ease(this.engine, "linearNone", infinite, start, end, @engine.current_frame, duration, invert_repeat, next)
quadOut: (start, end, duration, next = null, infinite = false , invert_repeat = false) ->
return new Ease(this.engine, "quadOut", infinite, start, end, @engine.current_frame, duration, invert_repeat, next)
quadIn: (start, end, duration, next = null, infinite = false , invert_repeat = false) ->
return new Ease(this.engine, "quadIn", infinite, start, end, @engine.current_frame, duration, invert_repeat, next)
quadInOut: (start, end, duration, next = null, infinite = false , invert_repeat = false) ->
return new Ease(this.engine, "quadInOut", infinite, start, end, @engine.current_frame, duration, invert_repeat, next)
quartOut: (start, end, duration, next = null, infinite = false , invert_repeat = false) ->
return new Ease(this.engine, "quartOut", infinite, start, end, @engine.current_frame, duration, invert_repeat, next)
quartIn: (start, end, duration, next = null, infinite = false , invert_repeat = false) ->
return new Ease(this.engine, "quartIn", infinite, start, end, @engine.current_frame, duration, invert_repeat, next)
quartInOut: (start, end, duration, next = null, infinite = false , invert_repeat = false) ->
return new Ease(this.engine, "quartInOut", infinite, start, end, @engine.current_frame, duration, invert_repeat, next)
sineOut: (start, end, duration, next = null, infinite = false , invert_repeat = false) ->
return new Ease(this.engine, "sineOut", infinite, start, end, @engine.current_frame, duration, invert_repeat, next)
sineIn: (start, end, duration, next = null, infinite = false , invert_repeat = false) ->
return new Ease(this.engine, "sineIn", infinite, start, end, @engine.current_frame, duration, invert_repeat, next)
sineInOut: (start, end, duration, next = null, infinite = false , invert_repeat = false) ->
return new Ease(this.engine, "sineInOut", infinite, start, end, @engine.current_frame, duration, invert_repeat, next)
class Ease
# Port based on https://github.com/jimjeffers/Easie. I don't think this qualifies as a "bad thing" :)
constructor: (@engine, @type, @infinite, @start, @end, @start_frame, @duration, @invert_repeat, @next, @params...) ->
@func = this[@type]
@change = @end - @start
@value = @start
@last_updated = @start_frame
@finished = false
# TODO: Investigate whether JS engines cache deterministic outcomes by themselves. If not,
# the below could provide some performance gain.
#@bounce_constant_1 = 1 / 2.75
#@bounce_constant_2 = 2 / 2.75
#@bounce_constant_3 = 2.5 / 2.75
goToNext: =>
@func = this[@next.type]
@change = @next.change
@value = @next.value
@start_frame = @last_updated = @engine.current_frame
@infinite = @next.infinite
@end = @next.end
@start = @next.start
@change = @next.change
@invert_repeat = @next.invert_repeat
@params = @next.params
@duration = @next.duration
@finished = false
@next = @next.next
abort: =>
@finished = true
updateValue: (current_frame) =>
# We recalculate here, to deal with 'stacked' easings. If we don't do this, letting multiple
# easings operate on each other will result in the final value being different from 'end',
# because the change was calculated once based on the value of the previous easing *at that
# moment*, rather than the actual value.
@change = @end - @start
if current_frame >= @start_frame + @duration
if @infinite
@start_frame = current_frame
if @invert_repeat
@start = @start + @change
@change = -@change
@value = @start
else if @next?
@goToNext()
else
@finished = true
@value = @start + @change
else
@value = @func(current_frame - @start_frame)
valueOf: =>
if not @finished and @engine.current_frame > @last_updated
@updateValue(@engine.current_frame)
@last_updated = @engine.current_frame
return @value
backIn: (time) =>
time = time / @duration
overshoot = @params[0]
return @change * time * time * ((overshoot + 1) * time - overshoot) + @start
backOut: (time) =>
time = time / @duration - 1
overshoot = @params[0]
return @change * (time * time * ((overshoot + 1) * time + overshoot) + 1) + @start
backInOut: (time) =>
time = time / (@duration / 2)
overshoot = @params[0] * 1.525
if time < 1
return @change / 2 * (time * time * ((overshoot + 1) * time - overshoot)) + @start
else
time -= 2
return @change / 2 * (time * time * ((overshoot + 1) * time + overshoot) + 2) + @start
bounceOut: (time, start = null) =>
time = time / @duration
start = start ? @start
if time < 1 / 2.75
return @change * (7.5625 * time * time) + start
else if time < 2 / 2.75
time = time - (1.5 / 2.75)
return @change * (7.5625 * time * time + 0.75) + start
else if time < 2.5 / 2.75
time = time - (2.25 / 2.75)
return @change * (7.5625 * time * time + 0.9375) + start
else
time = time - (2.625 / 2.75)
return @change * (7.5625 * time * time + 0.984375) + start
bounceIn: (time, start = null) =>
start = start ? @start
return @change - @bounceOut(@duration - time, 0) + start
bounceInOut: (time) =>
if time < @duration / 2
return @bounceIn(time * 2, 0) + @start
else
return @bounceOut(time * 2 - @duration, 0) + @start
circIn: (time) =>
time = time / @duration
return -@change * (Math.sqrt(1 - time * time) - 1) + @start
circOut: (time) =>
time = time / @duration - 1
return @change * Math.sqrt(1 - time * time) + @start
circInOut: (time) =>
time = time / (@duration / 2)
if time < 1
return -@change / 2 * (Math.sqrt(1 - time * time) - 1) + @start
else
time = time - 2
return @change / 2 * (Math.sqrt(1 - time * time) + 1) + @start
cubicIn: (time) =>
time = time / @duration
return @change * time * time * time + @start
cubicOut: (time) =>
time = time / @duration - 1
return @change * (time * time * time + 1) + @start
cubicInOut: (time) =>
time = time / (@duration / 2)
if time < 1
return change / 2 * time * time * time + @start
else
time = time - 2
return change / 2 * (time * time * time + 2) + begin
elasticOut: (time) =>
time = time / @duration
amplitude = @params[0]
period = @params[1]
overshoot = @params[2]
return (amplitude * Math.pow(2, -10 * time)) * Math.sin((time * @duration - overshoot) * (2 * Math.PI) / period) + @change + @start
elasticIn: (time) =>
time = time / @duration
amplitude = @params[0]
period = @params[1]
overshoot = @params[2]
return -(amplitude * Math.pow(2, -10 * time)) * Math.sin((time * @duration - overshoot) * (2 * Math.PI) / period) + @start
elasticInOut: (time) =>
time = time / (@duration / 2) - 1
amplitude = @params[0]
period = @params[1]
overshoot = @params[2]
if time < 1
return -0.5 * (amplitude * Math.pow(2, -10 * time)) * Math.sin((time * @duration - overshoot) * ((2 * Math.PI) / period)) + @start
else
return amplitude * Math.pow(2, -10 * time) * Math.sin((time * @duration - overshoot) * (2 * Math.PI) / period) + @change + @start
expoIn: (time) =>
return @change * Math.pow(2, 10 * (time / @duration - 1)) + @start
expoOut: (time) =>
return @change * (-Math.pow(2, -10 * time / @duration) + 1) + @start
expoInOut: (time) =>
time = time / (@duration / 2)
if time < 1
return @change / 2 * Math.pow(2, 10 * (time - 1)) + @start
else
return @change / 2 * (-Math.pow(2, -10 * (time - 1)) + 2) + @start
linearNone: (time) =>
return @change * time / @duration + @start
quadIn: (time) =>
time = time / @duration
return @change * time * time + @start
quadOut: (time) =>
time = time / @duration
return -@change * time * (time - 2) + @start
quadInOut: (time) =>
time = time / (@duration / 2)
if time < 1
return @change / 2 * time * time + @start
else
time = time - 1
return -@change / 2 * (time * (time - 2) - 1) + @start

@ -0,0 +1,13 @@
Engine::random =
number: (min, max, precision) =>
base_number = Math.random()
space = Math.abs(max - min)
rounding_factor = 1 / (precision ? 0.00000001)
return Math.floor((min + (base_number * space)) * rounding_factor) / rounding_factor
pick: (options...) =>
return options[Math.floor(Math.random() * options.length)]
string: (length, alphabet) =>
alphabet ?= "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
return (alphabet[Math.floor(Math.random() * alphabet.length)] for i in [0 .. length - 1]).join("")

@ -0,0 +1,30 @@
Engine::timing =
startTimer: (frames, callback, name = null, repeat = false) =>
timer = new Timer(frames, callback, repeat)
if name?
@named_timers[name] = timer
else
@unnamed_timers.push(timer)
stopTimer: (name) =>
@timers[name].stop()
class Timer
constructor: (@frames, @callback, @repeat) ->
@current_frame = 0
@finished = false
step: =>
if @current_frame >= @frames
@callback()
if repeat
@current_frame = 0
else
@finished = true
skip: (frames) =>
@current_frame += frames
stop: =>
@finished = true

@ -0,0 +1,50 @@
# NOTE: All class methods are loosely bound (ie. -> instead of =>). This is to
# make sure that @properties refer to instances of Objects, rather than
# the defaults set in the Object class.
class Object
constructor: (@engine, @name) ->
@sprite = null
@instances = []
@x = 0
@y = 0
callEvent: (name, data = {}) ->
event_map =
mouseover: @onMouseOver
mouseout: @onMouseOut
create: @onCreate
step: @onStep
click: @onClick
click_global: @onClickGlobal
switch name
when "draw"
@drawSelf(data.surface ? "")
@onDraw?(data)
else event_map[name]?.bind(this)(data)
drawSelf: (surface) ->
@drawSprite(surface)
drawSprite: (surface = "") ->
@sprite.draw(@x, @y, {}, surface) if @sprite? and (@draw_sprite ? "true")
getBoundingBox: ->
image_size = @sprite?.getSize()
return {
x1: @x
x2: @x + image_size?.width
y1: @y
y2: @y + image_size?.height
}
getInstances: ->
return @instances
checkPointCollision: (x, y) ->
# TODO: Precision collision matching!
bounding_box = @getBoundingBox()
return x >= bounding_box?.x1 and x <= bounding_box?.x2 and y >= bounding_box?.y1 and y <= bounding_box?.y2

@ -0,0 +1,140 @@
class ResourceManager
constructor: (@base_path = "") ->
@resources =
stage1_images: []
stage1_sounds: []
stage1_scripts: []
stage1_data: []
images: []
sounds: []
scripts: []
data: []
@resource_objects =
images: {}
sounds: {}
scripts: {}
data: {}
@base_path = util.stripRight(@base_path, "/") + "/"
@files_loaded = 0
@files_total = 0
@total_progress = 0
@file_progress = 0
joinPath: (path) =>
if @base_path == "" then path else @base_path + path
addImage: (path, first_stage = false) =>
if first_stage
@resources.stage1_images.push(path)
else
@resources.images.push(path)
addSound: (path, first_stage = false) =>
if first_stage
@resources.stage1_audio.push(path)
else
@resources.sounds.push(path)
addScript: (path, first_stage = false) =>
if first_stage
@resources.stage1_scripts.push(path)
else
@resources.scripts.push(path)
addDataFile: (path, first_stage = false) =>
if first_stage
@resources.stage1_data.push(path)
else
@resources.data.push(path)
addImages: (paths, first_stage = false) =>
@addImage(path, first_stage) for path in paths
addScripts: (paths, first_stage = false) =>
@addScript(path, first_stage) for path in paths
addSounds: (paths, first_stage = false) =>
@addSound(path, first_stage) for path in paths
addDataFiles: (paths, first_stage = false) =>
@addDataFile(path, first_stage) for path in paths
getImage: (path) =>
return @resource_objects.images[@joinPath(path)]
updateProgress: (event) =>
console.log(event)
@file_progress = event.loaded / event.total
handleFinishedFile: (event) =>
switch event.item.type
when createjs.LoadQueue.IMAGE then @resource_objects.images[event.item.src] = event.result
when createjs.LoadQueue.JAVASCRIPT then @resource_objects.scripts[event.item.src] = event.result
when createjs.LoadQueue.SOUND then @resource_objects.sounds[event.item.src] = event.result
when createjs.LoadQueue.JSON then @resource_objects.data[event.item.src] = event.result
if @current_stage == 2
@files_loaded += 1
@total_progress = @files_loaded / @files_total
handleComplete: (event) =>
stage = @current_stage
@finished_callback()
if stage == 1
@engine?.switchPreloadScene()
else if stage == 2
@engine?.switchInitialScene()
doPreload: (stage, progress_callback) =>
@current_stage = stage
if stage == 1
images = @resources.stage1_images
scripts = @resources.stage1_scripts
sounds = @resources.stage1_sounds
data_files = @resources.stage1_data
else
images = @resources.images
scripts = @resources.scripts
sounds = @resources.sounds
data_files = @resources.data
@queue = new createjs.LoadQueue(true, @base_path)
for image in images
@files_total += 1
@queue.loadFile({src: image, type: createjs.LoadQueue.IMAGE}, false)
for script in scripts
@files_total += 1
@queue.loadFile({src: script, type: createjs.LoadQueue.JAVASCRIPT}, false)
for sound in sounds
@files_total += 1
@queue.loadFile({src: sound, type: createjs.LoadQueue.SOUND}, false)
for data_file in data_files
@files_total += 1
@queue.loadFile({src: data_file, type: createjs.LoadQueue.JSON})
@queue.on("fileprogress", progress_callback)
@queue.on("fileload", @handleFinishedFile)
@queue.on("complete", @handleComplete)
@queue.load()
prepare: (finished_callback = (->)) =>
# This performs a stage 1 preload, loading the initial assets required for displaying the preload screen.
@finished_callback = finished_callback.bind(this)
@doPreload(1, (->))
load: (finished_callback = (->)) =>
# This performs the stage 2 preload; it will load the actual game assets.
@finished_callback = finished_callback.bind(this)
@doPreload(2, @updateProgress)

@ -0,0 +1,131 @@
class Scene
constructor: (@engine, @name) ->
@reset()
reset: =>
@instances = {}
@surfaces = []
@dirty = true # Triggers first draw
@last_instance_id = 100
@active = false
@width = 800
@height = 600
@last_width = 800
@last_height = 600
callEvent: (name, data = {}) =>
event_map =
load: @onLoad
switch name
when "destroy"
@destroySelf()
@onDestroy?(data)
else event_map[name]?.bind(this)(data)
addTargetSurface: (surface) =>
@surfaces.push(surface)
@engine.updateCanvasSize(surface, @width, @height)
$(surface).on("mousemove.radium", (event) =>
canvas_pos = surface.getBoundingClientRect()
@mouse_x = (event.clientX - canvas_pos.left) | 0
@mouse_y = (event.clientY - canvas_pos.top) | 0
@checkMouseCollisions()
)
$(surface).on("click.radium", (event) =>
@handleClick("click", event)
)
$(surface).on("mouseup.radium", (event) =>
@handleClick("mouse_up", event)
)
$(surface).on("mousedown.radium", (event) =>
@handleClick("mouse_down", event)
)
@checkActive()
handleClick: (event_name, event) =>
for id, instance of @instances
instance.callEvent("#{event_name}_global", {x: @mouse_x, y: @mouse_y, button: event.which})
if instance.checkPointCollision(@mouse_x, @mouse_y)
instance.callEvent(event_name, {x: @mouse_x, y: @mouse_y, button: event.which})
# Prevent default browser events from occurring on eg. right or middle click
event.preventDefault()
event.stopPropagation()
return false
removeTargetSurface: (surface) =>
@surfaces = @surfaces.filter (obj) -> obj isnt surface
$(surface).off("mousemove.radium")
@checkActive()
checkActive: =>
active_now = (@surfaces.length > 0)
if @active and not active_now
# Deactivated
@callEvent("destroy")
else if not @active and active_now
# Activated
@callEvent("load")
@active = active_now
iteration: =>
if @width != @last_width or @height != @last_height
@engine.updateCanvasSize(surface, @width, @height) for surface in @surfaces
[@last_width, @last_height] = [@width, @height]
for id, instance of @instances
if instance.callEvent("step")
@dirty = true
if @dirty
@redraw()
@dirty = false
redraw: =>
for surface in @surfaces
ctx = @engine.getSurface(surface)
ctx.clearRect(0, 0, surface.width, surface.height);
instance.callEvent("draw", {surface: surface}) for id, instance of @instances
checkMouseCollisions: =>
for id, instance of @instances
collision = instance.checkPointCollision(@mouse_x, @mouse_y)
if collision and not instance._moused_over
instance.callEvent("mouseover")
instance._moused_over = true
else if not collision and instance._moused_over
instance.callEvent("mouseout")
instance._moused_over = false
createInstance: (object, x = 0, y = 0) =>
id = @last_instance_id += 1
real_object = @engine.getObject(object)
instance = window.Object.create(real_object)
instance.x = x
instance.y = y
instance.id = id
instance.scene = this
@instances[id] = instance
real_object.instances.push(instance)
instance.callEvent("create")
return instance
changeScene: (scene) =>
# This will change to a different scene, but inherit the target surfaces
pass
destroySelf: =>
@reset

@ -0,0 +1 @@
class Sound

@ -0,0 +1,12 @@
class Sprite
constructor: (@engine, @name, @image) ->
{width: @width, height: @height} = @getSize()
draw: (x, y, options = {}, surface = "") =>
surface = @engine.getSurface(surface)
# TODO: Options.
surface.globalAlpha = options.alpha ? 1
surface.drawImage(@image, x, y)
getSize: =>
return {width: @image.width, height: @image.height}

@ -0,0 +1,30 @@
class Tileset
constructor: (@engine, @name, @image, @tile_width, @tile_height) ->
@tiles = {}
tile: (x, y, precise = false, w = 0, h = 0) =>
key = "#{x}/#{y}/#{w}/#{h}/" + if precise then 1 else 0
@tiles[key] ? tiles[key] = new TilesetTile(@engine, this, x, y, precise, w, h)
class TilesetTile
constructor: (@engine, @tileset, @x, @y, @precise = false, @w = 0, @h = 0) ->
pass
draw: (x, y) =>
if @precise
source_x = @x
source_y = @y
source_w = @w
source_h = @h
else
source_x = @x * @tileset.tile_width
source_y = @y * @tileset.tile_height
source_w = @tileset.tile_width
source_h = @tileset.tile_height
surface = @engine.getSurface()
# TODO: Options.
surface.drawImage(source_x, source_y, source_width, source_height, x, y)
getSize: =>
return if @precise then {width: @w, height: @h} else {width: @tileset.tile_width, height: @tileset.tile_height}

@ -0,0 +1,5 @@
util =
stripRight: (string, character) ->
string.replace(new RegExp(character + "*$", "g"), "")
unpackElement: (element) ->
if element instanceof jQuery then element[0] else element
Loading…
Cancel
Save