├── README.md ├── csharp └── python /README.md: -------------------------------------------------------------------------------- 1 | # Game-Development-Repository -------------------------------------------------------------------------------- /csharp: -------------------------------------------------------------------------------- 1 | // Example code for creating a game in Unity with C# 2 | using UnityEngine; 3 | 4 | public class PlayerController : MonoBehaviour 5 | { 6 | private void Update() 7 | { 8 | float moveHorizontal = Input.GetAxis("Horizontal"); 9 | float moveVertical = Input.GetAxis("Vertical"); 10 | 11 | Vector3 movement = new Vector3(moveHorizontal, 0.0f, moveVertical); 12 | GetComponent().AddForce(movement * speed * Time.deltaTime); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /python: -------------------------------------------------------------------------------- 1 | # Example code for creating a game with Pygame in Python 2 | import pygame 3 | 4 | pygame.init() 5 | 6 | # Define colors 7 | WHITE = (255, 255, 255) 8 | 9 | # Set screen dimensions 10 | size = (700, 500) 11 | screen = pygame.display.set_mode(size) 12 | 13 | # Set window title 14 | pygame.display.set_caption("My Game") 15 | 16 | # Main program loop 17 | running = True 18 | while running: 19 | for event in pygame.event.get(): 20 | if event.type == pygame.QUIT: 21 | running = False 22 | 23 | # Clear the screen and draw 24 | screen.fill(WHITE) 25 | 26 | # Update the screen 27 | pygame.display.flip() 28 | 29 | # Quit the program 30 | pygame.quit() 31 | --------------------------------------------------------------------------------