-
Notifications
You must be signed in to change notification settings - Fork 524
<!DOCTYPE html> #154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
hdjdjdudjdidjsjduejdjshhdhd-ops
wants to merge
1
commit into
github:release
from
hdjdjdudjdidjsjduejdjshhdhd-ops:release
Closed
<!DOCTYPE html> #154
hdjdjdudjdidjsjduejdjshhdhd-ops
wants to merge
1
commit into
github:release
from
hdjdjdudjdidjsjduejdjshhdhd-ops:release
Conversation
This file contains hidden or 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
<html> <head> <title>لعبة JavaScript بسيطة</title> <style> canvas { border: 1px solid black; } </style> </head> <body> <canvas id="gameCanvas" width="800" height="600"></canvas> <script> const canvas = document.getElementById("gameCanvas"); const ctx = canvas.getContext("2d"); let player = { x: 400, y: 500, width: 50, height: 50, speed: 5 }; function drawPlayer() { ctx.fillStyle = "red"; ctx.fillRect(player.x, player.y, player.width, player.height); } function gameLoop() { ctx.clearRect(0, 0, canvas.width, canvas.height); drawPlayer(); requestAnimationFrame(gameLoop); } window.addEventListener("keydown", (e) => { if (e.key === "ArrowLeft" && player.x > 0) player.x -= player.speed; if (e.key === "ArrowRight" && player.x < canvas.width - player.width) player.x += player.speed; }); gameLoop(); </script> </body> using UnityEngine; public class PlayerMovement : MonoBehaviour { public float moveSpeed = 5f; void Update() { float horizontal = Input.GetAxis("Horizontal"); float vertical = Input.GetAxis("Vertical"); Vector3 movement = new Vector3(horizontal, 0f, vertical) * moveSpeed * Time.deltaTime; transform.Translate(movement); } }import pygame pygame.init() # إنشاء نافذة اللعبة screen = pygame.display.set_mode((800, 600)) pygame.display.set_caption("لعبة بسيطة") # اللاعب (مربع صغير) player = pygame.Rect(400, 500, 50, 50) player_speed = 5 # اللعبة تعمل running = True while running: screen.fill((0, 0, 0)) # خلفية سوداء for event in pygame.event.get(): if event.type == pygame.QUIT: running = False # تحريك اللاعب بالأزرار keys = pygame.key.get_pressed() if keys[pygame.K_LEFT] and player.x > 0: player.x -= player_speed if keys[pygame.K_RIGHT] and player.x < 750: player.x += player_speed pygame.draw.rect(screen, (255, 0, 0), player) # رسم اللاعب pygame.display.update() pygame.quit() </html>
At the moment we are not accepting contributions to the repository. Feedback for Copilot.vim can be given in the feedback forum. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
At the moment we are not accepting contributions to the repository.