R36S Console Welcome Screen
Here's a modern, animated welcome screen for an R36S console with a gaming aesthetic:
import pygame
import sys
import math
import random
# Initialize pygame
pygame.init()
# Screen dimensions
WIDTH, HEIGHT = 800, 600
screen = pygame.display.set_mode((WIDTH, HEIGHT))
pygame.display.set_caption("R36S Console - Welcome")
# Colors
BACKGROUND = (15, 20, 30)
PRIMARY = (0, 180, 255)
SECONDARY = (255, 60, 90)
ACCENT = (0, 230, 150)
TEXT_COLOR = (220, 220, 220)
GRID_COLOR = (40, 50, 70)
# Fonts
title_font = pygame.font.SysFont("Arial", 60, bold=True)
subtitle_font = pygame.font.SysFont("Arial", 36)
button_font = pygame.font.SysFont("Arial", 28)
info_font = pygame.font.SysFont("Arial", 18)
# Console model
class ConsoleModel:
def __init__(self):
self.angle = 0
self.size = 200
self.position = (WIDTH // 2, HEIGHT // 2 - 50)
self.colors = [PRIMARY, SECONDARY, ACCENT]
def update(self):
self.angle += 0.01
def draw(self, surface):
# Draw the console body
x, y = self.position
# Main body
body_rect = pygame.Rect(0, 0, self.size, self.size // 2)
body_rect.center = (x, y)
pygame.draw.rect(surface, (30, 40, 60), body_rect, border_radius=15)
pygame.draw.rect(surface, (60, 80, 100), body_rect, width=3, border_radius=15)
# Screen
screen_rect = pygame.Rect(0, 0, self.size * 0.8, self.size * 0.3)
screen_rect.center = (x, y)
pygame.draw.rect(surface, (10, 15, 25), screen_rect, border_radius=8)
pygame.draw.rect(surface, PRIMARY, screen_rect, width=2, border_radius=8)
# Buttons
button_radius = self.size * 0.05
button_positions = [
(x - self.size * 0.3, y + self.size * 0.15),
(x - self.size * 0.15, y + self.size * 0.15),
(x + self.size * 0.15, y + self.size * 0.15),
(x + self.size * 0.3, y + self.size * 0.15),
]
for i, pos in enumerate(button_positions):
color = self.colors[i % len(self.colors)]
pygame.draw.circle(surface, color, pos, button_radius)
pygame.draw.circle(surface, (220, 220, 220), pos, button_radius, width=2)
# D-pad
d_pad_rect = pygame.Rect(0, 0, self.size * 0.2, self.size * 0.2)
d_pad_rect.center = (x - self.size * 0.3, y - self.size * 0.05)
pygame.draw.rect(surface, (50, 50, 60), d_pad_rect, border_radius=8)
pygame.draw.rect(surface, (150, 150, 160), d_pad_rect, width=2, border_radius=8)
# Analog sticks
stick_radius = self.size * 0.06
stick_positions = [
(x + self.size * 0.15, y - self.size * 0.1),
(x + self.size * 0.3, y - self.size * 0.05)
]
for pos in stick_positions:
pygame.draw.circle(surface, (40, 40, 50), pos, stick_radius)
pygame.draw.circle(surface, (180, 180, 190), pos, stick_radius, width=2)
# Particle system
class Particle:
def __init__(self):
self.reset()
def reset(self):
self.x = random.randint(0, WIDTH)
self.y = random.randint(0, HEIGHT)
self.size = random.randint(1, 3)
self.speed = random.uniform(0.5, 2)
self.color = random.choice([PRIMARY, SECONDARY, ACCENT])
self.alpha = random.randint(50, 200)
def update(self):
self.y -= self.speed
if self.y < -10:
self.reset()
def draw(self, surface):
s = pygame.Surface((self.size * 2, self.size * 2), pygame.SRCALPHA)
pygame.draw.circle(s, (*self.color, self.alpha), (self.size, self.size), self.size)
surface.blit(s, (self.x, self.y))
# Button class
class Button:
def __init__(self, x, y, width, height, text, color):
self.rect = pygame.Rect(x, y, width, height)
self.text = text
self.color = color
self.hover = False
def draw(self, surface):
color = self.color if not self.hover else ACCENT
pygame.draw.rect(surface, color, self.rect, border_radius=10)
pygame.draw.rect(surface, TEXT_COLOR, self.rect, width=2, border_radius=10)
text_surf = button_font.render(self.text, True, TEXT_COLOR)
text_rect = text_surf.get_rect(center=self.rect.center)
surface.blit(text_surf, text_rect)
def check_hover(self, pos):
self.hover = self.rect.collidepoint(pos)
return self.hover
def check_click(self, pos, event):
if event.type == pygame.MOUSEBUTTONDOWN and event.button == 1:
return self.rect.collidepoint(pos)
return False
# Create objects
console = ConsoleModel()
particles = [Particle() for _ in range(100)]
# Create buttons
start_button = Button(WIDTH//2 - 100, HEIGHT - 100, 200, 50, "START GAMING", PRIMARY)
# Main loop
clock = pygame.time.Clock()
running = True
pulse = 0
while running:
mouse_pos = pygame.mouse.get_pos()
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_ESCAPE:
running = False
# Check button clicks
if start_button.check_click(mouse_pos, event):
print("Start button clicked!")
# Update
console.update()
for p in particles:
p.update()
pulse = (pulse + 0.05) % (2 * math.pi)
# Check button hover
start_button.check_hover(mouse_pos)
# Draw
screen.fill(BACKGROUND)
# Draw grid
for x in range(0, WIDTH, 40):
pygame.draw.line(screen, GRID_COLOR, (x, 0), (x, HEIGHT), 1)
for y in range(0, HEIGHT, 40):
pygame.draw.line(screen, GRID_COLOR, (0, y), (WIDTH, y), 1)
# Draw particles
for p in particles:
p.draw(screen)
# Draw console
console.draw(screen)
# Draw title with pulsing effect
title_text = "R36S CONSOLE"
title_shadow = title_font.render(title_text, True, (0, 0, 0))
title_main = title_font.render(title_text, True, PRIMARY)
pulse_offset = math.sin(pulse) * 3
screen.blit(title_shadow, (WIDTH//2 - title_shadow.get_width()//2 + 3, 50 + 3))
screen.blit(title_main, (WIDTH//2 - title_main.get_width()//2, 50))
# Draw subtitle
subtitle_text = "RETRO GAMING REIMAGINED"
subtitle = subtitle_font.render(subtitle_text, True, TEXT_COLOR)
screen.blit(subtitle, (WIDTH//2 - subtitle.get_width()//2, 120))
# Draw info text
info_text = "Powered by PyGame • 64GB Storage • 5000mAh Battery"
info = info_font.render(info_text, True, (150, 150, 170))
screen.blit(info, (WIDTH//2 - info.get_width()//2, HEIGHT - 170))
# Draw buttons
start_button.draw(screen)
# Draw animated circle
circle_size = 20 + abs(math.sin(pulse)) * 10
circle_surf = pygame.Surface((circle_size * 2, circle_size * 2), pygame.SRCALPHA)
pygame.draw.circle(circle_surf, (*PRIMARY, 150), (circle_size, circle_size), circle_size)
screen.blit(circle_surf, (WIDTH//2 - circle_size, HEIGHT - 100 - circle_size))
pygame.display.flip()
clock.tick(60)
pygame.quit()
sys.exit()
Features of this Welcome Screen:
- Animated Console Model - A stylized R36S console with buttons, D-pad, and analog sticks
- Particle Effects - Floating particles that create a dynamic background
- Interactive UI Elements:
- "START GAMING" button with hover effect
- Animated pulsing circle indicator
- Dynamic Text Elements:
- Pulsing main title
- Subtle grid background
- Console specifications
- Responsive Design - Adapts to mouse movement with hover effects
To run this code, you'll need to have PyGame installed (pip install pygame). The welcome screen will display until you press ESC or close the window. Clicking the "START GAMING" button will print a message to the console.
Would you like me to make any adjustments to the design, such as:
- Changing the color scheme?
- Adding specific branding elements?
- Including additional console features?
- Modifying the animations or effects?