Code edit (1 edits merged)
Please save this source code
User prompt
add to the vertical axis dynamic values with a step of 50
Code edit (1 edits merged)
Please save this source code
User prompt
add dynamic values (step of 50) to the vertical axis
Code edit (3 edits merged)
Please save this source code
User prompt
fix text markers position because gui coordinates are not like other assets coordinates
User prompt
fix text markers position because LK.gui don't work with coordinates like game.height * 0.5
Code edit (4 edits merged)
Please save this source code
User prompt
add a series of 3 texts in the horizontal center of the screen to make stock value markers - text = "0$" at y=game.height*0.75 - text = "50$" at y=game.height*0.5 - text = "100$" at y=game.height*0.25
User prompt
flash the screen in the color of the button when pressed
Code edit (1 edits merged)
Please save this source code
User prompt
Set alpha of farbackground to 0.5
User prompt
Initialize the farBackground just before boardBackground
User prompt
Initialize farBackground like boardBackground
User prompt
Add a new background asset named FarBackground
Code edit (2 edits merged)
Please save this source code
User prompt
Add a new background asset named Board that will be placed under the current background
Code edit (4 edits merged)
Please save this source code
User prompt
Set horizontalAxis alpha to 0 when its y > game.height * 0.8 and else set it to 1
Code edit (4 edits merged)
Please save this source code
User prompt
Make buttons text a bit smaller when pressed to simulate press
Code edit (1 edits merged)
Please save this source code
User prompt
text of buttons should always be on top of buttons
User prompt
restore bigButton asset when buttons are released
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -182,138 +182,8 @@
/****
* Game Code
****/
-function _typeof(o) {
- "@babel/helpers - typeof";
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
- return typeof o;
- } : function (o) {
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
- }, _typeof(o);
-}
-function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
-}
-function _defineProperties(target, props) {
- for (var i = 0; i < props.length; i++) {
- var descriptor = props[i];
- descriptor.enumerable = descriptor.enumerable || false;
- descriptor.configurable = true;
- if ("value" in descriptor) {
- descriptor.writable = true;
- }
- Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
- }
-}
-function _createClass(Constructor, protoProps, staticProps) {
- if (protoProps) {
- _defineProperties(Constructor.prototype, protoProps);
- }
- if (staticProps) {
- _defineProperties(Constructor, staticProps);
- }
- Object.defineProperty(Constructor, "prototype", {
- writable: false
- });
- return Constructor;
-}
-function _toPropertyKey(t) {
- var i = _toPrimitive(t, "string");
- return "symbol" == _typeof(i) ? i : String(i);
-}
-function _toPrimitive(t, r) {
- if ("object" != _typeof(t) || !t) {
- return t;
- }
- var e = t[Symbol.toPrimitive];
- if (void 0 !== e) {
- var i = e.call(t, r || "default");
- if ("object" != _typeof(i)) {
- return i;
- }
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return ("string" === r ? String : Number)(t);
-}
-function _inherits(subClass, superClass) {
- if (typeof superClass !== "function" && superClass !== null) {
- throw new TypeError("Super expression must either be null or a function");
- }
- subClass.prototype = Object.create(superClass && superClass.prototype, {
- constructor: {
- value: subClass,
- writable: true,
- configurable: true
- }
- });
- Object.defineProperty(subClass, "prototype", {
- writable: false
- });
- if (superClass) {
- _setPrototypeOf(subClass, superClass);
- }
-}
-function _setPrototypeOf(o, p) {
- _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
- o.__proto__ = p;
- return o;
- };
- return _setPrototypeOf(o, p);
-}
-function _createSuper(Derived) {
- var hasNativeReflectConstruct = _isNativeReflectConstruct();
- return function _createSuperInternal() {
- var Super = _getPrototypeOf(Derived),
- result;
- if (hasNativeReflectConstruct) {
- var NewTarget = _getPrototypeOf(this).constructor;
- result = Reflect.construct(Super, arguments, NewTarget);
- } else {
- result = Super.apply(this, arguments);
- }
- return _possibleConstructorReturn(this, result);
- };
-}
-function _possibleConstructorReturn(self, call) {
- if (call && (_typeof(call) === "object" || typeof call === "function")) {
- return call;
- } else if (call !== void 0) {
- throw new TypeError("Derived constructors may only return object or undefined");
- }
- return _assertThisInitialized(self);
-}
-function _assertThisInitialized(self) {
- if (self === void 0) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
- return self;
-}
-function _isNativeReflectConstruct() {
- if (typeof Reflect === "undefined" || !Reflect.construct) {
- return false;
- }
- if (Reflect.construct.sham) {
- return false;
- }
- if (typeof Proxy === "function") {
- return true;
- }
- try {
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
- return true;
- } catch (e) {
- return false;
- }
-}
-function _getPrototypeOf(o) {
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
- return o.__proto__ || Object.getPrototypeOf(o);
- };
- return _getPrototypeOf(o);
-}
var slideAmount = 6.5;
var slideAmountVertical = 0.10; // Reduced speed for smoother vertical movement
var moveSegmentsVertically = false;
var verticalSlideThreshold = 500; // Define a global threshold for vertical sliding
@@ -376,44 +246,11 @@
horizontalAxis.width = game.width;
horizontalAxis.height = 10;
horizontalAxis.x = 0; // Move axis to the left side of the screen
// Create and draw fixed horizontal Marker axis
-// Create and draw vertical axis with dynamic values
-var DynamicVerticalAxis = /*#__PURE__*/function (_Axis) {
- _inherits(DynamicVerticalAxis, _Axis);
- var _super = _createSuper(DynamicVerticalAxis);
- function DynamicVerticalAxis() {
- var _this;
- _classCallCheck(this, DynamicVerticalAxis);
- _this = _super.call(this, true);
- _this.drawAxisWithValues();
- return _this;
- }
- _createClass(DynamicVerticalAxis, [{
- key: "drawAxisWithValues",
- value: function drawAxisWithValues() {
- this.drawAxis();
- var step = 50;
- var currentValue = 0;
- var axisHeight = game.height * 0.5;
- var numSteps = axisHeight / (dollarToYPixelRatio * step);
- for (var i = 0; i <= numSteps; i++) {
- var valueText = new Text2('$' + currentValue, {
- size: 30,
- fill: "#ffffff"
- });
- valueText.anchor.set(0.5, 0);
- valueText.rotation = -Math.PI / 2;
- valueText.x = -10;
- valueText.y = game.height * 0.75 - i * dollarToYPixelRatio * step;
- this.addChild(valueText);
- currentValue += step;
- }
- }
- }]);
- return DynamicVerticalAxis;
-}(Axis);
-var verticalAxis = game.addChild(new DynamicVerticalAxis());
+// Create and draw vertical axis
+var verticalAxis = game.addChild(new Axis(true)); // true indicates this is a vertical axis
+verticalAxis.drawAxis();
verticalAxis.rotation = Math.PI / 2; // Rotate to make it vertical
verticalAxis.x = 20; // Move axis to the left side of the screen
verticalAxis.width = game.height;
verticalAxis.height = 10;
A Technical dark background. Nothing just a gradiant of colors from black to dark blue. Theme : stock market. background
A modern clean empty rectangular button without borders. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
without shadow
a basic empty ui popup with a black background. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.