Code Sketch
Bixuu02
Category: Programming
// ============================================================
// ANIME UNIVERSE: ALL CHARACTERS, POWERS & FAMILIES SYSTEM
// ============================================================
cleari()
originBottomLeft()
// ============================================================
// APP STATES & VARIABLES
// ============================================================
var screen = 0 // 0: Letter, 1: Anime List, 2: Character List, 3: Character Detail, 4: Final Bixuu Message
var selectedAnime = ""
var selectedCharacter = ""
// Animation Variables for background stars/sparkles
class Star(val x: Double, val y: Double, val size: Double) {
var phase = randomDouble(6.28)
def step() { phase += 0.04 }
def view(canvas: CanvasDraw) {
val brightness = 150 + (math.sin(phase) * 80).toInt
canvas.noStroke()
canvas.fill(150, 200, 255, brightness)
canvas.ellipse(x, y, size, size)
}
}
val stars = ArrayBuffer.empty[Star]
for (i <- 0 until 50) {
stars.append(new Star(randomDouble(cwidth), randomDouble(cheight), 1.0 + randomDouble(2.5)))
}
// ============================================================
// SCREEN 0: WELCOME LETTER SCREEN
// ============================================================
def drawLetterScreen(canvas: CanvasDraw) {
canvas.background(15, 10, 30)
repeatFor(stars) { s => s.view(canvas) }
// Letter Card
canvas.fill(240, 240, 255)
canvas.stroke(138, 43, 226)
canvas.strokeWeight(4)
canvas.rect(cwidth/2 - 250, cheight/2 - 190, 500, 380)
// Title
canvas.fill(75, 0, 130)
canvas.text("ANIME UNIVERSE & ALL CHARACTERS", cwidth/2 - 180, cheight/2 + 150)
// Letter Body
canvas.fill(40, 40, 40)
canvas.text("Dear Anime Fan,", cwidth/2 - 220, cheight/2 + 110)
canvas.text("Welcome! Explore all characters, powers, and families", cwidth/2 - 220, cheight/2 + 80)
canvas.text("from Jujutsu Kaisen, Demon Slayer, Naruto,", cwidth/2 - 220, cheight/2 + 55)
canvas.text("and Attack on Titan in one place!", cwidth/2 - 220, cheight/2 + 30)
canvas.fill(0, 100, 0)
canvas.text("Click below to explore all Anime Series.", cwidth/2 - 220, cheight/2 - 10)
// Button: See All Anime
canvas.fill(138, 43, 226)
canvas.noStroke()
canvas.rect(cwidth/2 - 150, cheight/2 - 110, 300, 50)
canvas.fill(255, 255, 255)
canvas.text("EXPLORE ANIME WORLDS", cwidth/2 - 110, cheight/2 - 80)
}
// ============================================================
// SCREEN 1: SELECT ANIME SERIES (OR GO TO LAST)
// ============================================================
def drawAnimeSelectionScreen(canvas: CanvasDraw) {
canvas.background(20, 20, 35)
repeatFor(stars) { s => s.view(canvas) }
canvas.fill(255, 215, 0)
canvas.text("CHOOSE AN ANIME SERIES", cwidth/2 - 120, cheight - 35)
val animeNames = Array("Jujutsu Kaisen", "Demon Slayer", "Naruto Shippuden", "Attack on Titan")
for (i <- 0 until 4) {
val bx = if (i % 2 == 0) cwidth/2 - 220 else cwidth/2 + 20
val by = if (i < 2) cheight/2 + 30 else cheight/2 - 100
// Option Card Box
canvas.fill(240, 240, 255)
canvas.stroke(138, 43, 226)
canvas.strokeWeight(3)
canvas.rect(bx, by, 200, 90)
// Text inside box
canvas.fill(75, 0, 130)
canvas.noStroke()
canvas.text(animeNames(i), bx + 20, by + 45)
}
// "GO TO LAST" Button below options
canvas.fill(180, 50, 50)
canvas.noStroke()
canvas.rect(cwidth/2 - 120, 15, 240, 45)
canvas.fill(255, 255, 255)
canvas.text("GO TO LAST", cwidth/2 - 50, 35)
}
// ============================================================
// SCREEN 2: DISPLAY ALL CHARACTERS FOR SELECTED ANIME
// ============================================================
def drawCharacterListScreen(canvas: CanvasDraw) {
canvas.background(15, 20, 35)
repeatFor(stars) { s => s.view(canvas) }
canvas.fill(255, 215, 0)
canvas.text("SELECT A CHARACTER FROM: " + selectedAnime, cwidth/2 - 170, cheight - 35)
// Get character list based on selected anime
var chars = Array[String]()
if (selectedAnime == "Jujutsu Kaisen") {
chars = Array("Satoru Gojo", "Ryomen Sukuna", "Megumi Fushiguro", "Yuji Itadori")
} else if (selectedAnime == "Demon Slayer") {
chars = Array("Tanjiro Kamado", "Nezuko Kamado", "Zenitsu Agatsuma", "Muzan Kibutsuji")
} else if (selectedAnime == "Naruto Shippuden") {
chars = Array("Itachi Uchiha", "Naruto Uzumaki", "Sasuke Uchiha", "Kakashi Hatake")
} else if (selectedAnime == "Attack on Titan") {
chars = Array("Eren Yeager", "Mikasa Ackerman", "Levi Ackerman", "Armin Arlert")
}
for (i <- 0 until 4) {
val bx = if (i % 2 == 0) cwidth/2 - 220 else cwidth/2 + 20
val by = if (i < 2) cheight/2 + 30 else cheight/2 - 100
canvas.fill(245, 240, 255)
canvas.stroke(138, 43, 226)
canvas.strokeWeight(3)
canvas.rect(bx, by, 200, 90)
canvas.fill(75, 0, 130)
canvas.noStroke()
canvas.text(chars(i), bx + 15, by + 45)
}
// Back Button to Anime List
canvas.fill(138, 43, 226)
canvas.rect(cwidth/2 - 120, 15, 240, 40)
canvas.fill(255, 255, 255)
canvas.text("BACK TO ANIME LIST", cwidth/2 - 80, 32)
}
// ============================================================
// SCREEN 3: DISPLAY CHARACTER POWERS, FAMILY & DETAILS
// ============================================================
def drawCharacterDetailScreen(canvas: CanvasDraw) {
canvas.background(10, 15, 25)
repeatFor(stars) { s => s.view(canvas) }
// Header showing selected character
canvas.fill(255, 215, 0)
canvas.text(selectedCharacter, cwidth/2 - (selectedCharacter.length * 4), cheight - 35)
// Content Box for Details
canvas.fill(245, 245, 250)
canvas.stroke(138, 43, 226)
canvas.strokeWeight(3)
canvas.rect(cwidth/2 - 245, cheight/2 - 165, 490, 310)
canvas.fill(30, 30, 30)
canvas.noStroke()
// Display details based on selected Character
if (selectedCharacter == "Satoru Gojo") {
canvas.text("Anime: Jujutsu Kaisen", cwidth/2 - 230, cheight/2 + 115)
canvas.text("Family: Gojo Clan", cwidth/2 - 230, cheight/2 + 95)
canvas.text("Powers: Limitless, Infinity, Six Eyes, Domain Expansion", cwidth/2 - 230, cheight/2 + 75)
canvas.text("Highlights: Strongest modern Jujutsu Sorcerer.", cwidth/2 - 230, cheight/2 + 45)
canvas.text("\"Throughout Heaven and Earth, I alone am the honored one.\"", cwidth/2 - 230, cheight/2 + 20)
}
else if (selectedCharacter == "Ryomen Sukuna") {
canvas.text("Anime: Jujutsu Kaisen", cwidth/2 - 230, cheight/2 + 115)
canvas.text("Family: Unknown (King of Curses)", cwidth/2 - 230, cheight/2 + 95)
canvas.text("Powers: Cleave, Dismantle, Malevolent Shrine, Flame Arrow", cwidth/2 - 230, cheight/2 + 75)
canvas.text("Highlights: Feared historical curse sorcerer.", cwidth/2 - 230, cheight/2 + 45)
canvas.text("\"Stand proud, you are strong.\"", cwidth/2 - 230, cheight/2 + 20)
}
else if (selectedCharacter == "Megumi Fushiguro") {
canvas.text("Anime: Jujutsu Kaisen", cwidth/2 - 230, cheight/2 + 115)
canvas.text("Family: Fushiguro Family (Father: Toji Zenin)", cwidth/2 - 230, cheight/2 + 95)
canvas.text("Powers: Ten Shadows Technique, Divine Dogs, Chimera Shadow Garden", cwidth/2 - 230, cheight/2 + 75)
canvas.text("Highlights: Talented student of Satoru Gojo.", cwidth/2 - 230, cheight/2 + 45)
}
else if (selectedCharacter == "Yuji Itadori") {
canvas.text("Anime: Jujutsu Kaisen", cwidth/2 - 230, cheight/2 + 115)
canvas.text("Family: Itadori Family (Grandfather: Wasuke)", cwidth/2 - 230, cheight/2 + 95)
canvas.text("Powers: Divergent Fist, Black Flash, Sukuna Vessel", cwidth/2 - 230, cheight/2 + 75)
canvas.text("Highlights: Main protagonist with superhuman physical strength.", cwidth/2 - 230, cheight/2 + 45)
}
else if (selectedCharacter == "Tanjiro Kamado") {
canvas.text("Anime: Demon Slayer", cwidth/2 - 230, cheight/2 + 115)
canvas.text("Family: Kamado Family (Sister: Nezuko)", cwidth/2 - 230, cheight/2 + 95)
canvas.text("Powers: Water Breathing, Hinokami Kagura (Sun Breathing)", cwidth/2 - 230, cheight/2 + 75)
canvas.text("Highlights: Slayer aiming to cure his sister.", cwidth/2 - 230, cheight/2 + 45)
}
else if (selectedCharacter == "Nezuko Kamado") {
canvas.text("Anime: Demon Slayer", cwidth/2 - 230, cheight/2 + 115)
canvas.text("Family: Kamado Family (Brother: Tanjiro)", cwidth/2 - 230, cheight/2 + 95)
canvas.text("Powers: Demon Blood Art, Exploding Blood, Shrinking Form", cwidth/2 - 230, cheight/2 + 75)
canvas.text("Highlights: Unique demon who protects humans.", cwidth/2 - 230, cheight/2 + 45)
}
else if (selectedCharacter == "Zenitsu Agatsuma") {
canvas.text("Anime: Demon Slayer", cwidth/2 - 230, cheight/2 + 115)
canvas.text("Family: Trained by Jigoro Kuwajima", cwidth/2 - 230, cheight/2 + 95)
canvas.text("Powers: Thunder Breathing - First Form: Thunderclap and Flash", cwidth/2 - 230, cheight/2 + 75)
canvas.text("Highlights: Powerful when fighting while unconscious.", cwidth/2 - 230, cheight/2 + 45)
}
else if (selectedCharacter == "Muzan Kibutsuji") {
canvas.text("Anime: Demon Slayer", cwidth/2 - 230, cheight/2 + 115)
canvas.text("Family: Progenitor of all Demons", cwidth/2 - 230, cheight/2 + 95)
canvas.text("Powers: Shapeshifting, Tentacle Whips, Absolute Regeneration", cwidth/2 - 230, cheight/2 + 75)
canvas.text("Highlights: The ultimate villain and Demon King.", cwidth/2 - 230, cheight/2 + 45)
}
else if (selectedCharacter == "Itachi Uchiha") {
canvas.text("Anime: Naruto Shippuden", cwidth/2 - 230, cheight/2 + 115)
canvas.text("Family: Uchiha Clan (Brother: Sasuke)", cwidth/2 - 230, cheight/2 + 95)
canvas.text("Powers: Mangekyo Sharingan, Amaterasu, Susanoo, Genjutsu", cwidth/2 - 230, cheight/2 + 75)
canvas.text("Highlights: Legendary ninja who protected his village from shadows.", cwidth/2 - 230, cheight/2 + 45)
}
else if (selectedCharacter == "Naruto Uzumaki") {
canvas.text("Anime: Naruto Shippuden", cwidth/2 - 230, cheight/2 + 115)
canvas.text("Family: Uzumaki Clan (Father: Minato, Mother: Kushina)", cwidth/2 - 230, cheight/2 + 95)
canvas.text("Powers: Rasengan, Shadow Clone Jutsu, Sage Mode, Nine-Tails Chakra", cwidth/2 - 230, cheight/2 + 75)
canvas.text("Highlights: 7th Hokage of the Hidden Leaf Village.", cwidth/2 - 230, cheight/2 + 45)
}
else if (selectedCharacter == "Sasuke Uchiha") {
canvas.text("Anime: Naruto Shippuden", cwidth/2 - 230, cheight/2 + 115)
canvas.text("Family: Uchiha Clan (Brother: Itachi)", cwidth/2 - 230, cheight/2 + 95)
canvas.text("Powers: Rinnegan, Eternal Mangekyo Sharingan, Chidori, Susanoo", cwidth/2 - 230, cheight/2 + 75)
canvas.text("Highlights: The shadow hokage and rival of Naruto.", cwidth/2 - 230, cheight/2 + 45)
}
else if (selectedCharacter == "Kakashi Hatake") {
canvas.text("Anime: Naruto Shippuden", cwidth/2 - 230, cheight/2 + 115)
canvas.text("Family: Hatake Clan (Father: Sakumo Hatake)", cwidth/2 - 230, cheight/2 + 95)
canvas.text("Powers: Sharingan, Chidori, Lightning Blade, Copy Ninja Skills", cwidth/2 - 230, cheight/2 + 75)
canvas.text("Highlights: 6th Hokage and mentor of Team 7.", cwidth/2 - 230, cheight/2 + 45)
}
else if (selectedCharacter == "Eren Yeager") {
canvas.text("Anime: Attack on Titan", cwidth/2 - 230, cheight/2 + 115)
canvas.text("Family: Yeager Family (Father: Grisha)", cwidth/2 - 230, cheight/2 + 95)
canvas.text("Powers: Attack Titan, Founding Titan, War Hammer Titan", cwidth/2 - 230, cheight/2 + 75)
canvas.text("Highlights: Fought for freedom and changed the world.", cwidth/2 - 230, cheight/2 + 45)
}
else if (selectedCharacter == "Mikasa Ackerman") {
canvas.text("Anime: Attack on Titan", cwidth/2 - 230, cheight/2 + 115)
canvas.text("Family: Ackerman Clan", cwidth/2 - 230, cheight/2 + 95)
canvas.text("Powers: Ackerman Awakening, Expert ODM Gear Combat", cwidth/2 - 230, cheight/2 + 75)
canvas.text("Highlights: Elite soldier and protector of Eren.", cwidth/2 - 230, cheight/2 + 45)
}
else if (selectedCharacter == "Levi Ackerman") {
canvas.text("Anime: Attack on Titan", cwidth/2 - 230, cheight/2 + 115)
canvas.text("Family: Ackerman Clan", cwidth/2 - 230, cheight/2 + 95)
canvas.text("Powers: Ackerman Awakening, Supreme Blade Speed", cwidth/2 - 230, cheight/2 + 75)
canvas.text("Highlights: Humanity's strongest soldier.", cwidth/2 - 230, cheight/2 + 45)
}
else if (selectedCharacter == "Armin Arlert") {
canvas.text("Anime: Attack on Titan", cwidth/2 - 230, cheight/2 + 115)
canvas.text("Family: Arlert Family", cwidth/2 - 230, cheight/2 + 95)
canvas.text("Powers: Colossal Titan, Tactical Genius Mind", cwidth/2 - 230, cheight/2 + 75)
canvas.text("Highlights: Brilliant strategist and 15th Commander of Survey Corps.", cwidth/2 - 230, cheight/2 + 45)
}
// Bottom Navigation: Back to Character List
canvas.fill(138, 43, 226)
canvas.rect(cwidth/2 - 140, 15, 280, 40)
canvas.fill(255, 255, 255)
canvas.text("BACK TO CHARACTERS", cwidth/2 - 80, 32)
}
// ============================================================
// SCREEN 4: FINAL DEDICATION SCREEN (BIXUU MESSAGE)
// ============================================================
def drawFinalScreen(canvas: CanvasDraw) {
canvas.background(20, 10, 30)
repeatFor(stars) { s => s.view(canvas) }
// Message Card
canvas.fill(240, 240, 255)
canvas.stroke(138, 43, 226)
canvas.strokeWeight(4)
canvas.rect(cwidth/2 - 240, cheight/2 - 140, 480, 280)
canvas.fill(138, 43, 226)
canvas.text("THANK YOU FOR EXPLORING ANIME!", cwidth/2 - 150, cheight/2 + 95)
canvas.fill(40, 40, 40)
canvas.text("bixuu will keep making best and new", cwidth/2 - 210, cheight/2 + 45)
canvas.text("anime character games for you!", cwidth/2 - 210, cheight/2 + 20)
canvas.fill(0, 100, 150)
canvas.text("Stay tuned for more legendary powers!", cwidth/2 - 210, cheight/2 - 15)
// Back to Home Button
canvas.fill(75, 0, 130)
canvas.noStroke()
canvas.rect(cwidth/2 - 120, 20, 240, 45)
canvas.fill(255, 255, 255)
canvas.text("RESTART APP", cwidth/2 - 50, 40)
}
// ============================================================
// CLICK HANDLER
// ============================================================
def handleClick(x: Double, y: Double) {
if (screen == 0) {
// Click "EXPLORE ANIME WORLDS"
if (x >= cwidth/2 - 150 && x <= cwidth/2 + 150 && y >= cheight/2 - 110 && y <= cheight/2 - 60) {
screen = 1
}
}
else if (screen == 1) {
// Check click on "GO TO LAST" Button
if (x >= cwidth/2 - 120 && x <= cwidth/2 + 120 && y >= 15 && y <= 60) {
screen = 4
} else {
// Select one of the Anime Series
val animeNames = Array("Jujutsu Kaisen", "Demon Slayer", "Naruto Shippuden", "Attack on Titan")
for (i <- 0 until 4) {
val bx = if (i % 2 == 0) cwidth/2 - 220 else cwidth/2 + 20
val by = if (i < 2) cheight/2 + 30 else cheight/2 - 100
if (x >= bx && x <= bx + 200 && y >= by && y <= by + 90) {
selectedAnime = animeNames(i)
screen = 2 // Go to Character List screen
}
}
}
}
else if (screen == 2) {
// Click "BACK TO ANIME LIST"
if (x >= cwidth/2 - 120 && x <= cwidth/2 + 120 && y >= 15 && y <= 55) {
screen = 1
} else {
// Select one of the characters from the list
var chars = Array[String]()
if (selectedAnime == "Jujutsu Kaisen") {
chars = Array("Satoru Gojo", "Ryomen Sukuna", "Megumi Fushiguro", "Yuji Itadori")
} else if (selectedAnime == "Demon Slayer") {
chars = Array("Tanjiro Kamado", "Nezuko Kamado", "Zenitsu Agatsuma", "Muzan Kibutsuji")
} else if (selectedAnime == "Naruto Shippuden") {
chars = Array("Itachi Uchiha", "Naruto Uzumaki", "Sasuke Uchiha", "Kakashi Hatake")
} else if (selectedAnime == "Attack on Titan") {
chars = Array("Eren Yeager", "Mikasa Ackerman", "Levi Ackerman", "Armin Arlert")
}
for (i <- 0 until 4) {
val bx = if (i % 2 == 0) cwidth/2 - 220 else cwidth/2 + 20
val by = if (i < 2) cheight/2 + 30 else cheight/2 - 100
if (x >= bx && x <= bx + 200 && y >= by && y <= by + 90) {
selectedCharacter = chars(i)
screen = 3 // Go to Character Detail screen
}
}
}
}
else if (screen == 3) {
// Click "BACK TO CHARACTERS"
if (x >= cwidth/2 - 140 && x <= cwidth/2 + 140 && y >= 15 && y <= 55) {
screen = 2
}
}
else if (screen == 4) {
// Click "RESTART APP"
if (x >= cwidth/2 - 120 && x <= cwidth/2 + 120 && y >= 20 && y <= 65) {
screen = 0
}
}
}
onMouseClick { (x, y) => handleClick(x, y) }
// ============================================================
// MAIN ANIMATION LOOP
// ============================================================
animateWithCanvasDraw { canvas =>
repeatFor(stars) { s => s.step() }
if (screen == 0) {
drawLetterScreen(canvas)
} else if (screen == 1) {
drawAnimeSelectionScreen(canvas)
} else if (screen == 2) {
drawCharacterListScreen(canvas)
} else if (screen == 3) {
drawCharacterDetailScreen(canvas)
} else if (screen == 4) {
drawFinalScreen(canvas)
}
}