Uzay Anil

@UzayAnil (24)
I like most coding languages.Mostly C++,Python,Python 2.7,and MOSTLY:HTML. My favorite repl is at https://repl.it/@UzayAnil/GAMESHTML
Fortnite Battle Royale 2D
posted to Share by Rcastrp

I am kind of concerned that this isn't a real game :(

Space Invaders
posted to Share by Foster_Bryant
Space Invaders
posted to Share by Foster_Bryant

Not really too much, I update my tetris game yesterday. If you want to check it out, here you go https://www.repl.it/@UzayAnil/Tetris .while your at my account, also check out some other stuff. @Foster_Bryant

Space Invaders
posted to Share by Foster_Bryant

@Foster_Bryant here is Space Invaders on GitHub: https://github.com/UzayAnil/invaders

Space Invaders
posted to Share by Foster_Bryant
Space Invaders
posted to Share by Foster_Bryant

For your first PyGame program, this is impressive.

🎮 Tetris [without canvas !]
posted to Share by smrsan761

Thank you for these @smrsan761
1.you are right, I fixed it, it now gives you the same block if you cannot place it (you will still lose a point though.)

Sorry, I don't understand 2.

This isn't included as 3., but I added game instructions too (for no reason.)

C++ TETRIS
posted to Share by tluszczyk

It's weird because you need to press ENTER every time you want to move or rotate, by the way, here is my tetris game; https://repl.it/@UzayAnil/ANOTHER-CTEST ; I'm trying to make it 2d now that it's 1d right now.

Python Turtle Maze
posted to Share by 18cyrj

Nice!

Space Whale Shooter
posted to Share by CarysS

MY_SCORE = 248

Sharing file with output text
posted to Ask by TylerBeck2

this doesn't work for me, it keeps saying:
Traceback (most recent call last):
File "main.py", line 1, in <module>
from colorama import init
ModuleNotFoundError: No module named "colorama"

The lottery!! (99% of people can't win) NOT CLICK BAIT
posted to Share by Daniel_Campos

I matched all of them!(I stole your answer, Sorry @Tricksyz)

Treasure hunt Game
posted to Share by UzayAnil
EVEN MORE APPROXIMATIONS OF π!!
posted to Share by LizFoster

noooooooooooooooooiiiiiiiiiiiiiiiccccccccccccce!

(noice)

Github
posted to Ask by Dhruvsharma8

not rily @nt998302

Github
posted to Ask by Dhruvsharma8

you need to write the compiler of the coding language of the clone, for HTML, just type HTML in the search bar of the clone and should work, unless the clone is too big, or Syntax errors(errors in general)

Minecraft
posted to Share by duck132912

I do not use my school account for repl.it @duck132912

Minecraft
posted to Share by duck132912

a chromebook at [email protected]

Minecraft
posted to Share by duck132912

I use a home chromebook @duck132912

Typing Basketball Game
posted to Share by Sonic_fanfan
Minecraft
posted to Share by duck132912

i cant play

Youtube
posted to Share by A17aphillips

do ctrl+u to enter source code for any web

Golf - Programming Language
posted to Share by AdCharity

by the way, here's another one(last one.)<!DOCTYPE html>

<html> <head> <title></title> <style> html, body { height: 100%; margin: 0; }

body {
background: black;
display: flex;
align-items: center;
justify-content: center;
}
</style>

</head> <body> <canvas width="400" height="500" id="game"></canvas> <script> const canvas = document.getElementById('game'); const context = canvas.getContext('2d');

// each row is 14 bricks long. the level consists of 6 blank rows then 8 rows
// of 4 colors: red, orange, green, and yellow
const level1 = [
[],
[],
[],
[],
[],
[],
['R','R','R','R','R','R','R','R','R','R','R','R','R','R'],
['R','R','R','R','R','R','R','R','R','R','R','R','R','R'],
['O','O','O','O','O','O','O','O','O','O','O','O','O','O'],
['O','O','O','O','O','O','O','O','O','O','O','O','O','O'],
['G','G','G','G','G','G','G','G','G','G','G','G','G','G'],
['G','G','G','G','G','G','G','G','G','G','G','G','G','G'],
['Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'],
['Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y']
];

// create a mapping between color short code (R, O, G, Y) and color name
const colorMap = {
'R': 'red',
'O': 'orange',
'G': 'green',
'Y': 'yellow'
};

// use a 2px gap between each brick
const brickGap = 2;
const brickWidth = 25;
const brickHeight = 12;

// the wall width takes up the remaining space of the canvas width. with 14 bricks
// and 13 2px gaps between them, thats: 400 - (14 25 + 2 13) = 24px. so each
// wall will be 12px
const wallSize = 12;
const bricks = [];

// create the level by looping over each row and column in the level1 array
// and creating an object with the bricks position (x, y) and color
for (let row = 0; row < level1.length; row++) {
for (let col = 0; col < level1[row].length; col++) {
const colorCode = level1[row];

bricks.push({
  x: wallSize + (brickWidth + brickGap) * col,
  y: wallSize + (brickHeight + brickGap) * row,
  color: colorMap[colorCode],
  width: brickWidth,
  height: brickHeight
});

}
}

const paddle = {
// place the paddle horizontally in the middle of the screen
x: canvas.width / 2 - brickWidth / 2,
y: 440,
width: brickWidth,
height: brickHeight,

// paddle x velocity
dx: 0
};

const ball = {
x: 130,
y: 260,
width: 5,
height: 5,

// how fast the ball should go in either the x or y direction
speed: 2,

// ball velocity
dx: 0,
dy: 0
};

// check for collision between two objects using axis-aligned bounding box (AABB)
// @see https://developer.mozilla.org/en-US/docs/Games/Techniques/2D_collision_detection
function collides(obj1, obj2) {
return obj1.x < obj2.x + obj2.width &&
obj1.x + obj1.width > obj2.x &&
obj1.y < obj2.y + obj2.height &&
obj1.y + obj1.height > obj2.y;
}

// game loop
function loop() {
requestAnimationFrame(loop);
context.clearRect(0,0,canvas.width,canvas.height);

// move paddle by it's velocity
paddle.x += paddle.dx;

// prevent paddle from going through walls
if (paddle.x < wallSize) {
paddle.x = wallSize
}
else if (paddle.x + brickWidth > canvas.width - wallSize) {
paddle.x = canvas.width - wallSize - brickWidth;
}

// move ball by it's velocity
ball.x += ball.dx;
ball.y += ball.dy;

// prevent ball from going through walls by changing its velocity
// left & right walls
if (ball.x < wallSize) {
ball.x = wallSize;
ball.dx = -1;
}
else if (ball.x + ball.width > canvas.width - wallSize) {
ball.x = canvas.width - wallSize - ball.width;
ball.dx
= -1;
}
// top wall
if (ball.y < wallSize) {
ball.y = wallSize;
ball.dy *= -1;
}

// reset ball if it goes below the screen
if (ball.y > canvas.height) {
ball.x = 130;
ball.y = 260;
ball.dx = 0;
ball.dy = 0;
}

// check to see if ball collides with paddle. if they do change y velocity
if (collides(ball, paddle)) {
ball.dy *= -1;

// move ball above the paddle otherwise the collision will happen again
// in the next frame
ball.y = paddle.y - ball.height;

}

// check to see if ball collides with a brick. if it does, remove the brick
// and change the ball velocity based on the side the brick was hit on
for (let i = 0; i < bricks.length; i++) {
const brick = bricks[i];

if (collides(ball, brick)) {
  // remove brick from the bricks array
  bricks.splice(i, 1);

  // ball is above or below the brick, change y velocity
  // account for the balls speed since it will be inside the brick when it
  // collides
  if (ball.y + ball.height - ball.speed <= brick.y ||
      ball.y >= brick.y + brick.height - ball.speed) {
    ball.dy *= -1;
  }
  // ball is on either side of the brick, change x velocity
  else {
    ball.dx *= -1;
  }

  break;
}

}

// draw walls
context.fillStyle = 'lightgrey';
context.fillRect(0, 0, canvas.width, wallSize);
context.fillRect(0, 0, wallSize, canvas.height);
context.fillRect(canvas.width - wallSize, 0, wallSize, canvas.height);

// draw ball if it's moving
if (ball.dx || ball.dy) {
context.fillRect(ball.x, ball.y, ball.width, ball.height);
}

// draw bricks
bricks.forEach(function(brick) {
context.fillStyle = brick.color;
context.fillRect(brick.x, brick.y, brick.width, brick.height);
});

// draw paddle
context.fillStyle = 'cyan';
context.fillRect(paddle.x, paddle.y, paddle.width, paddle.height);
}

// listen to keyboard events to move the paddle
document.addEventListener('keydown', function(e) {
// left arrow key
if (e.which === 37) {
paddle.dx = -3;
}
// right arrow key
else if (e.which === 39) {
paddle.dx = 3;
}

// space key
// if they ball is not moving, we can launch the ball using the space key. ball
// will move towards the bottom right to start
if (ball.dx === 0 && ball.dy === 0 && e.which === 32) {
ball.dx = ball.speed;
ball.dy = ball.speed;
}
});

// listen to keyboard events to stop the paddle if key is released
document.addEventListener('keyup', function(e) {
if (e.which === 37 || e.which === 39) {
paddle.dx = 0;
}
});

// start the game
requestAnimationFrame(loop);
</script>

</body> </html> @AdCharity
Golf - Programming Language
posted to Share by AdCharity

here is one thing I made in Re:HTML https://rehtml.adcharity.repl.co
if the code isn't there do this.

<!DOCTYPE html><html> <head> <title></title> <style> html, body { height: 100%; margin: 0; }

body {
background: black;
display: flex;
align-items: center;
justify-content: center;
}
canvas {
border: 1px solid white;
}
</style>

</head> <body> <canvas width="400" height="400" id="game"></canvas> <script> var canvas = document.getElementById('game'); var context = canvas.getContext('2d');

var grid = 16;
var count = 0;

var snake = {
x: 160,
y: 160,

// snake velocity. moves one grid length every frame in either the x or y direction
dx: grid,
dy: 0,

// keep track of all grids the snake body occupies
cells: [],

// length of the snake. grows when eating an apple
maxCells: 4
};
var apple = {
x: 320,
y: 320
};

// get random whole numbers in a specific range
// @see https://stackoverflow.com/a/1527820/2124254
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min)) + min;
}

// game loop
function loop() {
requestAnimationFrame(loop);

// slow game loop to 15 fps instead of 60 (60/15 = 4)
if (++count < 4) {
return;
}

count = 0;
context.clearRect(0,0,canvas.width,canvas.height);

// move snake by it's velocity
snake.x += snake.dx;
snake.y += snake.dy;

// wrap snake position horizontally on edge of screen
if (snake.x < 0) {
snake.x = canvas.width - grid;
}
else if (snake.x >= canvas.width) {
snake.x = 0;
}

// wrap snake position vertically on edge of screen
if (snake.y < 0) {
snake.y = canvas.height - grid;
}
else if (snake.y >= canvas.height) {
snake.y = 0;
}

// keep track of where snake has been. front of the array is always the head
snake.cells.unshift({x: snake.x, y: snake.y});

// remove cells as we move away from them
if (snake.cells.length > snake.maxCells) {
snake.cells.pop();
}

// draw apple
context.fillStyle = 'red';
context.fillRect(apple.x, apple.y, grid-1, grid-1);

// draw snake one cell at a time
context.fillStyle = 'green';
snake.cells.forEach(function(cell, index) {

// drawing 1 px smaller than the grid creates a grid effect in the snake body so you can see how long it is
context.fillRect(cell.x, cell.y, grid-1, grid-1);  

// snake ate apple
if (cell.x === apple.x && cell.y === apple.y) {
  snake.maxCells++;

  // canvas is 400x400 which is 25x25 grids 
  apple.x = getRandomInt(0, 25) * grid;
  apple.y = getRandomInt(0, 25) * grid;
}

// check collision with all cells after this one (modified bubble sort)
for (var i = index + 1; i < snake.cells.length; i++) {
  
  // snake occupies same space as a body part. reset game
  if (cell.x === snake.cells[i].x && cell.y === snake.cells[i].y) {
    snake.x = 160;
    snake.y = 160;
    snake.cells = [];
    snake.maxCells = 4;
    snake.dx = grid;
    snake.dy = 0;

    apple.x = getRandomInt(0, 25) * grid;
    apple.y = getRandomInt(0, 25) * grid;
  }
}

});
}

// listen to keyboard events to move the snake
document.addEventListener('keydown', function(e) {
// prevent snake from backtracking on itself by checking that it's
// not already moving on the same axis (pressing left while moving
// left won't do anything, and pressing right while moving left
// shouldn't let you collide with your own body)

// left arrow key
if (e.which === 37 && snake.dx === 0) {
snake.dx = -grid;
snake.dy = 0;
}
// up arrow key
else if (e.which === 38 && snake.dy === 0) {
snake.dy = -grid;
snake.dx = 0;
}
// right arrow key
else if (e.which === 39 && snake.dx === 0) {
snake.dx = grid;
snake.dy = 0;
}
// down arrow key
else if (e.which === 40 && snake.dy === 0) {
snake.dy = grid;
snake.dx = 0;
}
});

// start the game
requestAnimationFrame(loop);
</script>

</body> </html>
Snake
posted to Share by UzayAnil

No, I just wanted to see what highscore people could get in this game. Since this is MIT Licensed, and I thought this was a really cool game, I wanted to reshare it. @AdCharity

Snake
posted to Share by UzayAnil

My Highscore is 12. Reply to me if you beat it!

Space Invaders
posted to Share by Foster_Bryant

Never Mind, it doesn't work on replit. @Foster_Bryant

Submit New Stock Name
posted to Share by mamamia5x

BRUH, honestly?

1-8 Gambling
posted to Share by EliMolzahn

I FINALLY WON!!!!!!!!!!!!!!!!!!!!!!!!!!! (It took me 8 minutes)

Pattern Detecting Random Number Guesser
posted to Share by TylerCooper

A little bit easy for it to not guess your number, can you make it 0-25 to make it more challenging.