Created
October 2, 2017 07:17
-
-
Save ysfzrn/50775ee2d8f7bdc47172efb31418ed5d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
import mobx, { observable, action } from "mobx"; | |
import { AsyncStorage } from "react-native"; | |
const segmentRate = 10; // yılanın her hareketinde katedeceği mesafe | |
class GameStore { | |
@observable highScore = 0; //yapılan en yüksek skoru tutar | |
@observable score = 0; // yiyilen elma sayısı | |
@observable intervalRate = 15; //yılanın hızı | |
@observable currentDirection = "right"; // Yılanın yönü, alacağı değerler: left / right / up / down | |
@observable lastSegment = 10; // her segmentin kendinden önce takip edeceği, segment | |
@observable // yılanı oluşturan array ve başlangıç koordinatları | |
snake = [ | |
{ id: 1, x: 20, y: 0 }, | |
{ id: 2, x: 10, y: 0 }, | |
{ id: 3, x: 0, y: 0 } | |
]; | |
... | |
} | |
export default new GameStore(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment