mirror of
https://github.com/Heretek-AI/GDevelop.git
synced 2026-07-25 04:15:49 -04:00
ad2f3d45f4
Added call to StripUnimplementedInstructionsAndExpressions to not fully implemented extensions. Improved ShootJS.gdg Added Collisions benchmark.gdg : 7/8 fps with Chrome 27 on my computer. git-svn-id: svn://localhost@1030 8062f311-0dae-4547-b526-b8ab9ac864a5
33 lines
606 B
JavaScript
33 lines
606 B
JavaScript
|
|
/**
|
|
* variable is an object storing a number or a string
|
|
* @class variable
|
|
*/
|
|
gdjs.variable = function(value)
|
|
{
|
|
var that = {};
|
|
var my = {};
|
|
|
|
my.value = value || 0;
|
|
|
|
/**
|
|
* Get the value of the variable
|
|
* @method getValue
|
|
* @return {Any} The value stored
|
|
*/
|
|
that.getValue = function() {
|
|
return my.value;
|
|
}
|
|
|
|
/**
|
|
* Change the value of the variable
|
|
* @method setValue
|
|
* @param newValue {Any} The new value to be set
|
|
*/
|
|
that.setValue = function(newValue) {
|
|
my.value = newValue;
|
|
}
|
|
|
|
return that;
|
|
}
|