Pet Trading
Build an Adopt Me Rarity Trading System in Scratch | Junior Coderz
Adopt Me Pet Trading System in Scratch

Every kid who has spent time in Adopt Me knows the thrill of proposing a Pet Trading deal. Stacking rare pets, checking rarity values, and waiting to see if the other player accepts or declines is one of the most exciting moments in any Roblox session. Now your child can build that same system from the ground up using Scratch! In this tutorial, we walk through creating a full Adopt Me-inspired pet inventory, a rarity tier system, and trade proposal logic. Along the way, kids learn variables, lists, conditionals, and user interface design. Every mechanic teaches a real programming concept that transfers to Python, JavaScript, and beyond. Whether you are a parent looking for creative screen time, an educator searching for classroom-ready Scratch projects, or a kid who wants to code something genuinely exciting, this guide covers every step.

🐾 The Story: The Great Pet Exchange

In the town of Codeville, pets are everything. Each resident carries a glowing pet capsule containing creatures of different rarities: common frogs, uncommon foxes, rare dragons, and the legendary Rainbow Griffin. Trade booths line the main square where players offer and accept deals all day long.

A young inventor named Pip built a trading terminal that could automatically calculate whether a trade was fair. Pip’s invention used rarity scores, inventory tracking, and a clever accept/decline button system. Word spread. Soon every trader in Codeville wanted one. Now you get to build Pip’s machine yourself, and make it even better.

Why This Scratch Trading System Is the Perfect Kids Project

Adopt Me has over 531,000 concurrent players because its Pet Trading mechanic is brilliantly simple on the surface yet deeply strategic underneath. Kids spend hours calculating trade values, comparing rarity tiers, and deciding whether to accept or walk away. By building this system in Scratch, they learn exactly how those calculations work in code. Specifically, inventory management teaches list manipulation. Rarity tiers teach data structures and comparison logic. Trade proposals teach event-driven programming and boolean flags.

Furthermore, this project naturally motivates learners because they are recreating something they already love. They are not coding an abstract exercise. Instead, they are building a tool they would genuinely want to use. If your child has already built projects like a Blox Fruits Power System or a Piggy Escape Game, this project is the ideal next challenge in data management and UI design.

Planning Your Pet Trading System: The Blueprint

Before opening Scratch, sketch the full system on paper. A complete trading project needs four core parts: an inventory that stores owned pets, a rarity system that assigns point values to each pet, a trade proposal screen where one player offers pets, and a trade logic engine that compares total rarity values and determines whether a deal is fair. Planning these pieces separately makes the building process much smoother.

System Component Details
Pet InventoryA list storing each player’s current pets
Rarity TiersCommon (10), Uncommon (25), Rare (50), Ultra-Rare (100), Legendary (250)
Trade Offer ScreenPlayers select pets to offer and receive
Trade Logic EngineCompares total rarity values of both sides
Accept / Decline ButtonsTrigger trade completion or cancellation
Trade History LogOptional list of completed trades

This planning phase builds computational thinking. Breaking a complex system into separate, buildable components is the same approach real engineers use. For more on how this problem-solving mindset shapes young coders, explore our post on engineering mindset lessons for kids.

Building the Pet Inventory System in Scratch

The inventory is the foundation of everything. It stores each player’s pets as a Scratch list, where each item represents a pet name. Create two lists: “player1Inventory” and “player2Inventory.” Each list starts with three random pets. When a trade completes, items move between lists. When a trade is declined, nothing changes. This simple add-and-remove logic teaches kids how databases work at a fundamental level.

Inventory Setup Code (Stage)

when green flag clicked
delete all of [player1Inventory v]
delete all of [player2Inventory v]
add [Dragon] to [player1Inventory v]
add [Fox] to [player1Inventory v]
add [Frog] to [player1Inventory v]
add [Griffin] to [player2Inventory v]
add [Cat] to [player2Inventory v]
add [Unicorn] to [player2Inventory v]
set [selectedOffer v] to []
set [selectedRequest v] to []

Each inventory starts clean when the game begins. The “selectedOffer” variable tracks which pet Player 1 is offering. The “selectedRequest” variable tracks which pet they want in return. When the player clicks a pet sprite in their inventory, it sets selectedOffer to that pet’s name. Clicking a pet from the other player’s display sets selectedRequest. This click-to-select system teaches event handling and variable assignment. For more on how inventories and shops work in Scratch, check our tutorial on building shop systems in Scratch.

Coding Rarity Tiers: The Heart of Every Pet Trading Calculator

Rarity tiers are what give pets their value. Without them, every trade would be equal. With them, kids must think strategically about which pets are worth trading and which are too precious to give up. In Scratch, rarity values are stored in a parallel list called “rarityValues.” Each index in “rarityValues” corresponds to a pet name in a “petNames” list. When the system needs to know a pet’s value, it finds the pet’s position in “petNames” and reads the matching number from “rarityValues.”

Pet Name 🐾 Rarity Tier Point Value
FrogCommon10
CatCommon10
FoxUncommon25
DogUncommon25
DragonRare50
UnicornRare50
Shadow DragonUltra-Rare100
GriffinLegendary250
Rarity Lookup Code

when green flag clicked
delete all of [petNames v]
delete all of [rarityValues v]
add [Frog] to [petNames v]
add [10] to [rarityValues v]
add [Cat] to [petNames v]
add [10] to [rarityValues v]
add [Fox] to [petNames v]
add [25] to [rarityValues v]
add [Dragon] to [petNames v]
add [50] to [rarityValues v]
add [Griffin] to [petNames v]
add [250] to [rarityValues v]

define getRarity [petName]
set [searchIndex v] to (1)
repeat (length of [petNames v])
  if <(item (searchIndex) of [petNames v]) = (petName)> then
    set [foundRarity v] to (item (searchIndex) of [rarityValues v])
  end
  change [searchIndex v] by (1)
end

The “getRarity” custom block acts as a lookup function. It searches through the petNames list until it finds a match, then reads the corresponding value from rarityValues. This parallel list technique is a fundamental data structure pattern used in professional programming. Notably, it teaches kids about indexing, searching, and data retrieval. Similarly, this is the exact logic that powers online rarity calculators for Adopt Me. For more on how parallel lists and data structures work, explore the Algorithm Avengers program at Junior Coderz.

🐾 Design Tip: Give each rarity tier a color! Common pets show a grey badge, uncommon pets show green, rare pets show blue, ultra-rare pets show purple, and legendary pets glow with a gold animated badge. Visual rarity cues make the game feel instantly more polished and professional!

Building the Pet Trading Proposal and Accept Logic

The trade proposal screen is where the excitement happens. When Player 1 selects a pet to offer and a pet to request, they hit the “Propose Trade” button. This fires a broadcast that shows Player 2 the offer details and presents two buttons: Accept and Decline. The fair trade checker then runs automatically. If both sides have equal rarity value, the Accept button glows green. If the values are unequal, a “Questionable Trade” warning appears.

Trade Proposal and Fair Check Code

when [Propose Trade button v] clicked
if <<(selectedOffer) <> []> and <(selectedRequest) <> []>> then
  call getRarity [selectedOffer]
  set [offerValue v] to (foundRarity)
  call getRarity [selectedRequest]
  set [requestValue v] to (foundRarity)
  broadcast [showTradeScreen v]
  if <(offerValue) = (requestValue)> then
    set [tradeStatus v] to [Fair Trade!]
  else
    set [tradeStatus v] to [Check the values!]
  end
end

The proposal system checks that both selected pets are not empty before proceeding. Consequently, this prevents broken trades with no pets selected. Furthermore, it calls the getRarity function for both pets, stores their values, and then compares them. The tradeStatus variable updates the on-screen label so players immediately see whether the deal is balanced. This conditional comparison is one of the most important programming concepts in all of coding. Indeed, virtually every database application, e-commerce platform, and matching algorithm uses the same logic.

Completing and Cancelling Trades in Your Scratch Game

When Player 2 hits Accept, the trade executes. This means removing the offered pet from Player 1’s inventory and adding it to Player 2’s. At the same time, the requested pet moves in the opposite direction. When Player 2 hits Decline, nothing changes and both players return to the main screen. These two paths teach kids about branching logic and the importance of reversibility in system design.

Trade Execute Code

when I receive [tradeAccepted v]
:: Remove offered pet from Player 1 and give it to Player 2
set [offerPos v] to (item# of (selectedOffer) in [player1Inventory v])
delete (offerPos) of [player1Inventory v]
add (selectedOffer) to [player2Inventory v]
:: Remove requested pet from Player 2 and give it to Player 1
set [requestPos v] to (item# of (selectedRequest) in [player2Inventory v])
delete (requestPos) of [player2Inventory v]
add (selectedRequest) to [player1Inventory v]
:: Reset selections
set [selectedOffer v] to []
set [selectedRequest v] to []
broadcast [tradeComplete v]
play sound [success v]

The “item# of” block finds the exact position of a pet in the list. Subsequently, the “delete” block removes it at that position. Finally, the “add” block places it in the other player’s list. This sequence mirrors how real database transactions work: find, remove, insert, and confirm. Moreover, the sound effect and “tradeComplete” broadcast trigger a celebration animation. This teaches kids about user feedback and the importance of confirming successful actions. For comparison, see how similar item exchange logic works in our guide on Scratch shop systems.

Displaying Inventories and Trade Screens in Your Game

A great user interface turns a functional system into a delightful experience. Create a pet card sprite with multiple costumes, one for each pet. When the inventory updates, regenerate the displayed cards. Each card shows the pet’s name, rarity tier badge, and a small illustrated icon. Position Player 1’s inventory on the left side of the screen and Player 2’s on the right. Place the trade proposal area in the center.

For the rarity badges, use color coding. A small badge sprite switches costume based on the pet’s tier. Common pets show grey. Uncommon pets show green. Rare pets show blue. Ultra-Rare pets show purple. Legendary pets display a glowing gold animation with three cycling costume frames. These visual details make the system feel alive. In addition, add a floating “+1” animation when a pet successfully transfers to a new inventory. This small touch rewards the player with satisfying visual feedback on every completed trade. These polish techniques are similar to the ones explored in our tutorial on building a Scratch Music Maker, where sound and visual feedback design takes center stage.

Cool Extensions for Your Pet Trading Project

Once the core system works, extensions make it extraordinary. Here are five ideas that each teach new programming concepts and add real depth to the game.

Extension Idea Concept Learned Difficulty
Pet Aging System (newborn to neon)Variable modifiers, milestonesMedium
Trade History LogLists, timestamping, displayEasy
Random Pet Egg HatchRandomization, rarity oddsMedium
Multi-Pet Trades (3 for 1)List summation, complex comparisonHard
Scam Alert SystemThresholds, warning flags, UIMedium

The scam alert system is particularly interesting from a design perspective. Specifically, if one player’s offered rarity is more than twice the requested rarity, a red “Unfair Trade!” banner appears and the Accept button temporarily disables. This teaches threshold-based conditionals and protective UI design. Students ready for multi-pet logic and advanced list operations thrive in the Scratch Coding program at Junior Coderz.

What Kids Learn by Building This Scratch Trading Project

This project covers a remarkable range of real programming concepts. Lists store and manage the pet inventories. Parallel lists implement the rarity lookup database. Custom blocks create reusable functions. Conditionals power the fair trade checker and scam detector. Broadcasts coordinate the trade proposal, acceptance, and completion flow. String matching finds pets by name inside lists. Variable tracking manages selected pets and rarity scores. Essentially, these are the same foundational skills used in app development, database design, and backend engineering.

Beyond the code, kids also develop product thinking. They consider user experience by designing clear trade screens. They think about edge cases by wondering what happens if a player has no pets. Furthermore, they build mathematical intuition by balancing rarity values across tiers. Above all, they finish with a working system they are proud to show. These skills prepare students directly for advanced courses. To understand how projects like this connect to the bigger picture of STEM learning, read our guide on coding in STEM education.

Ready to Help Your Child Build Something Amazing?

If this project got your child excited about coding, imagine what they could build with expert guidance! At Junior Coderz, kids aged 6 to 18 learn Scratch programming, game development, Python, AI, and more through live online classes. Every session is hands-on, project-based, and led by professional engineers who make coding genuinely exciting and memorable.

Whether your child is a complete beginner or already building complex projects, we have the perfect course for them. For example, the AI Hybrid Course dives deep into machine learning and automation. Meanwhile, our Scratch workshops turn creative ideas into real, shareable projects. Book a completely free trial class today and experience the magic firsthand! Follow us on Instagram and Facebook for daily coding inspiration and student spotlights!

🐾 Book Your Free Trial Class

Conclusion: Code the Trade, Build the Future

Building an Adopt Me-style Pet Trading system in Scratch is one of the most technically rich and genuinely fun projects a young coder can tackle. Through this single project, kids master lists, parallel data structures, custom functions, conditionals, broadcasts, and user interface design. They design a rarity economy, write a trade logic engine, and polish the experience with visual feedback and animations. Most importantly, they finish with something they understand from the inside out.

Whether your child continues building in Scratch or moves on to Python and AI, the data management skills from this project transfer directly to every programming language and platform. So open Scratch, set up those lists, write that first rarity lookup, and start building. Pip’s trading terminal is waiting to be recreated. If you want expert guidance at every step, Junior Coderz is here to help. Connect with us on LinkedIn for new courses, student success stories, and the latest in coding education for kids. The trade booth is open!

FAQs

Kids aged 10 to 14 enjoy this project most. Younger kids (10 to 11) can build the inventory lists and basic rarity display. Older kids (12 to 14) can add the full trade logic engine, multi-pet trades, and the scam alert system. Some Scratch experience with lists and variables is helpful before starting.

The system stores pet names and their rarity values in two parallel lists. When a trade is proposed, a custom block searches the names list for each selected pet, reads its matching rarity value from the second list, and compares the two numbers. If the values match, the trade is flagged as fair. If one side is higher, a warning appears. This is the same logic used in online Adopt Me value calculators.

A basic version with inventory lists, rarity lookup, and a simple accept/decline flow takes about 3 to 4 hours. The full version with visual pet cards, rarity badges, animations, and a scam alert system could take 7 to 10 hours across multiple sessions. Scratch saves automatically, so kids can build one feature at a time over several days.

Absolutely! The parallel list system makes adding new pets very easy. Simply add a new pet name to the “petNames” list and its corresponding value to “rarityValues” during setup. You can add dozens of pets this way without changing any other code. Kids can also add a “Neon” tier that multiplies a pet’s base value by 4 and a “Mega Neon” tier that multiplies by 16.

After mastering lists and data structures in Scratch, kids are ready for advanced projects like a Blox Fruits RPG system or a full horror escape game. When ready for text-based coding, Python is the natural next step. Junior Coderz offers the AI Hybrid Course and Algorithm Avengers for teens leveling up.

Leave a Reply

Your email address will not be published. Required fields are marked *

Junior Coderz

Book Your Free Trial Class!