Skip to main content

Can I create my own social media channels to showcase my games or playtest games created by others?

Comments

7 comments

  • Gajendra Kumar

    YK GAMING STUDIO

    0
  • Gajendra Kumar

    VERY GOOD

    0
  • Aasta Darkyy
    0
  • ShivCharan kewat S.K

    1413121110987431

    var Snake = (function () {

    2

    3

    4

    const gameingworld= 5;

    var fixedTail = true;

    5

    6

    7

    8

    9

    var intervalID;

    var tileCount = 10;

    var gridSize = 400/tileCount;

    10

    11

    const INITIAL_PLAYER = { x: Math .floor(tileCount / 2), y: Math .floor(tileCount / 2) };

    12

    13

    var velocity = { x:0, y:0 };

    14

    var player = { x: INITIAL_PLAYER.x, y: INITIAL_PLAYER.y };

    var walls = false;

    15

    16

    17

    18

    var fruit = { x:4, y:4};

    19

    var trail = [];

    21

    20

    var tail INITIAL_TAIL;

    22

    var reward = 5;

    23

    24

    var points = 0;

    25

    var pointsMax = 10000000000;

    26

    var ActionEnum = { 'none': 0, 'up': 1 'down': 2, 'left':3, 'right':4}

    27

    (2545552534951474845464344ctx.fillStyle42404138393637343533document.getElementById32313029Object.freeze528

    ; champ: 5

    Object.freeze (ActionEnum);

    29

    var lastAction = ActionEnum.none;

    30

    31

    function setup () {

    32

    canv = document.getElementById

    ('gc');

    33

    ctx = canv.getContext('2d');

    34

    game.reset();

    35

    36

    }

    37

    38

    var game = {

    39

    40

    reset: function () {

    41

    ctx.fillStyle = 'grey';

    42

    ctx.fillRect(0, 0, canv.width, canv.height);

    43

    44

    tail = INITIAL_TAIL;

    45

    points = 0;

    46

    velocity.x = 0;

    47

    velocity.y = 0;

    48

    49

    player.x = INITIAL_PLAYER.x;

    50

    player.y = INITIAL_PLAYER.y;

    51

    // this. RandomFruit();

    52

    53

    reward=-1;

    54

    lastAction = ActionEnum.none;

    55

    trail = [];28798077787576737471726970676865666416263616058595705656

    50

    trail.push({x: player.x, y:

    57

    player.y });

    // for(var j = 0 ; i<tail; i++)

    trail.push({x: player.x, y: player.y });

    58

    },

    59

    action: {

    61

    60

    up: function () {

    62

    if (lastAction != ActionEnum

    63

    .down) {

    64

    velocity.x x = 0 ;

    velocity.y y = - 1 ;

    65

    }

    66

    },

    67

    down: function () {

    68

    if (lastAction != ActionEnum

    . up) {

    69

    velocity.x = 0;

    70

    velocity.y y = 1 ;

    71

    }

    72

    },

    73

    left: function () {

    74

    if (lastAction != ActionEnum

    .right) {

    75

    velocity.x x = - 1 ;

    76

    velocity.y y = 0 ;

    77

    }

    78

    },

    right: function () {

    79

    if (lastAction != ActionEnum

    80

    .left) {104103102trail.length1011009998979695949392919089888786858483825081

    4G

    50

    velocity.x = 1;

    82

    velocity.y = 0;

    83

    }

    84

    }

    85

    },

    86

    87

    RandomFruit: function () {

    88

    if(walls) {

    89

    fruit.x = 1+Math.floor(Math .random() * (tileCount-2));

    90

    fruit.y = 1+Math.floor(Math * .random() (tileCount-2));

    91

    }

    92

    else {

    93

    fruit.x= Math.floor(Math .random() * tileCount);

    94

    fruit.y = Math.floor(Math .random() * tileCount);

    95

    }

    96

    },

    97

    98

    log: function () {

    99

    console.log('

    100

    console.log('x:' + player.x + , y:' + player.y);

    101

    console.log('tail:' + tail + ', trail.length:' + trail.length );

    102

    },

    103

    loop function (){

    104

    () if = ! && :8150

    0
  • Rahil Khan

    Gana

     

    0
  • Rahil Khan

    Gama

    0

Please sign in to leave a comment.

Powered by Zendesk