Virtual Pet Game Template
  • VIRTUAL PET GAME TEMPLATE
  • Getting Started
    • ๐ŸŽฏ Project Setup Guide
    • ๐Ÿงฉ Home Scene Overview
    • ๐Ÿ—บ๏ธ UI Main Menu
    • ๐Ÿ—บ๏ธ LoadingManager
    • ๐Ÿ—บ๏ธ GameInstance
    • ๐Ÿ—บ๏ธ ToolsManager
    • ๐Ÿ—บ๏ธ AudioManager
    • ๐Ÿ—บ๏ธ LanguageManager
    • ๐Ÿ—บ๏ธ MonetizationManager
    • ๐Ÿ—บ๏ธ PlayerSave
  • Modifying the project
    • ๐Ÿพ How to Add a New Pet
    • ๐Ÿ“œHow Add a New Pet Rules
    • ๐Ÿ’ฐ How to Add a New Currency
    • ๐ŸŽ How to Add a New Food Item
    • ๐Ÿงข Adding a New Accessory
    • ๐ŸŽฎ How to Add a New Minigame
  • Modifying Minigames
    • ๐ŸŒค๏ธ Minigame "Jump Sky"
    • ๐Ÿ” Minigame "Food Flicker"
    • ๐Ÿฆ Minigame โ€œFlappyโ€
    • ๐Ÿ’Ž Minigame โ€œGem Hunterโ€
Powered by GitBook
On this page
  • ๐Ÿชœ How to Add New Stages
  • ๐Ÿงฑ How to Modify Platforms
  • ๐Ÿง Player Setup
  • ๐ŸŽฎ Gameplay Flow
  • ๐Ÿงพ Tips
  1. Modifying Minigames

๐ŸŒค๏ธ Minigame "Jump Sky"

Editing the "Jump Sky" Minigame

The Jump Sky minigame challenges the player to ascend by jumping across platforms while collecting coins. It is structured in vertical stages with specific rules for spawning platforms, coins, and visual feedback. Here's how to customize or expand it:

๐Ÿชœ How to Add New Stages

Each vertical stage is defined using a StageDefinitionJump ScriptableObject.

โž• Steps to Create a New Stage:

  1. Right-click in the Project panel โ†’ Create โ†’ PetCareGame โ†’ Minigame-Jump โ†’ Stage Definition

  2. Configure the following fields:

    • minHeight / maxHeight: Defines the vertical range in world-space Y where this stage applies.

    • stageColor: Background color applied when the player is in this stage.

    • platformPrefabs: List of platform prefabs to randomly spawn in this stage.

    • coinPrefabs: List of coin prefabs that may spawn with platforms.

    • lineSpacing: Distance between horizontal rows of platforms.

    • maxPlatformsPerLine: Maximum number of platforms per row.

    • coinSpawnChance: Probability of spawning a coin per platform.

    • minGold / maxGold: Range of gold rewarded per coin.

โœ… Assign the new stage:

In the GameManager GameObject (found in the Minigame_Jump scene), add your new StageDefinitionJump asset to the stages list in the Inspector.


๐Ÿงฑ How to Modify Platforms

Platforms are spawned dynamically and must follow two key rules:

  1. Tag and Layer:

    • Assign the Tag "Platform"

    • Assign the Layer "Platform"

  2. Prefab Setup:

    • Ensure your platform prefab has the correct Collider2D or Collider component.

    • Any special behavior (e.g. moving, breaking, bouncing) can be scripted and added per prefab.

Example:

plaintextCopiarEditarPlatform_Moving.prefab
โ””โ”€โ”€ Tag: Platform
โ””โ”€โ”€ Layer: Platform
โ””โ”€โ”€ Components: SpriteRenderer, BoxCollider2D, MovingPlatform.cs

๐Ÿง Player Setup

The player character used in the Jump Sky scene must:

  • Have the Tag "Player"

  • Be on the Layer "Player"

This is essential for proper collision detection with the DeadZone, platforms, and other mechanics.


๐ŸŽฎ Gameplay Flow

  • The player starts jumping from the base.

  • As they ascend, the BlockSpawnerJump loads new stages based on their Y position.

  • The background color changes depending on the current stage.

  • Coins grant gold, and reaching a defined finalHeight results in a Win.

  • Falling below a certain threshold triggers a Lose state.


๐Ÿงพ Tips

  • Stage order matters โ€“ the first stages in the list will be used for lower altitudes.

  • Avoid overlapping min/max height ranges between stages to prevent unpredictable transitions.

  • You can reuse platforms and coins across stages or create entirely new visuals per stage for variation.

Previous๐ŸŽฎ How to Add a New MinigameNext๐Ÿ” Minigame "Food Flicker"

Last updated 28 days ago