From b21644b7ab93e861584c531b0e3df7d0474be591 Mon Sep 17 00:00:00 2001 From: hdjdjdudjdidjsjduejdjshhdhd-ops Date: Sat, 2 Aug 2025 20:37:59 +0000 Subject: [PATCH] =?UTF-8?q?=20=20=20=20=20=20?= =?UTF-8?q?=20=D9=84=D8=B9=D8=A8=D8=A9=20JavaScript=20=D8=A8=D8=B3?= =?UTF-8?q?=D9=8A=D8=B7=D8=A9=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20 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()