SAME-001: My New Character – Open Code And SVG Preview

November 8, 2024
by
SAME-001: My New Character

I’m excited to share something special with you today from my upcoming adventure game project that features SAME-001. While I’m keeping the full game under wraps for now (stay tuned!), I wanted to give back to the developer community by sharing the code and design process for one of our characters: SAME-001, an Egyptian-inspired warrior with mystical combat abilities.

Key design elements included:

  • Egyptian-inspired headdress with gold and navy blue colors
  • Mystical staff with golden ornaments
  • Flowing navy blue combat dress with gold trim
  • Dynamic pose structure emphasizing agility and power

Open Source Code

data class Position(val x: Float, val y: Float)
data class AnimationState(val currentFrame: Int, val totalFrames: Int)

class Same001(
    private var position: Position = Position(0f, 0f),
    private var health: Int = 120,
    private var mana: Int = 100,
    private var isChanneling: Boolean = false
) {
    // Core stats
    private val baseAttackDamage = 30
    private val baseMagicDamage = 45
    private val baseDefense = 20
    private val movementSpeed = 4.5f
    
    // Special states
    private var currentAnimationState = AnimationState(0, 12)
    private var isAttacking = false
    private var magicShieldActive = false
    
    // Combat mechanics
    fun castMagicAttack(): Int {
        if (!isChanneling && mana >= 25) {
            isAttacking = true
            mana -= 25
            return baseMagicDamage
        }
        return 0
    }
    
    fun staffStrike(): Int {
        if (!isChanneling && mana >= 15) {
            isAttacking = true
            mana -= 15
            return baseAttackDamage
        }
        return 0
    }
    
    fun activateMagicShield() {
        if (mana >= 30) {
            magicShieldActive = true
            isChanneling = true
            mana -= 30
        }
    }
    
    // Movement and positioning
    fun move(dx: Float, dy: Float) {
        if (!isChanneling) {
            position = Position(
                position.x + dx * movementSpeed,
                position.y + dy * movementSpeed
            )
        }
    }
    
    // Damage handling
    fun takeDamage(damage: Int): Int {
        val actualDamage = when {
            magicShieldActive -> damage / 3
            isChanneling -> damage / 2
            else -> damage
        }
        health -= actualDamage.coerceAtLeast(0)
        return actualDamage
    }
    
    // Resource management
    fun regenerateMana() {
        if (!isAttacking && mana < 100) {
            mana += 5
        }
    }
    
    // State management
    fun updateState() {
        if (isChanneling && mana <= 0) {
            isChanneling = false
            magicShieldActive = false
        }
    }
    
    // Animation system
    fun updateAnimation() {
        currentAnimationState = AnimationState(
            (currentAnimationState.currentFrame + 1) % currentAnimationState.totalFrames,
            currentAnimationState.totalFrames
        )
    }
    
    // Getters
    fun getHealth() = health
    fun getMana() = mana
    fun getPosition() = position
    fun isChanneling() = isChanneling
    fun isMagicShieldActive() = magicShieldActive
}

Key Character Features:

  1. Enhanced Magical Combat System:
  • Implements a dual combat system combining staff strikes and magical attacks.
  • Features a mana-based resource system for special abilities.
  • Includes a unique magic shield mechanism for defense.
  1. Core Combat Attributes:
  • Base health pool of 120 points for increased survivability.
  • Mana pool of 100 points for sustained magical combat.
  • Balanced movement speed of 4.5 units for tactical positioning.
  • Defensive capability of 20 points for physical resistance.
  1. Special Abilities:
  • Magic Shield reduces incoming damage by 66% when active.
  • Channeling state provides 50% damage reduction.
  • Staff Strike costs 15 mana and deals physical damage.
  • Magic Attack costs 25 mana and deals enhanced magical damage.
  1. Technical Implementation Details:
  • Position system uses floating-point precision for smooth movement.
  • Animation framework supports 12 frames per animation sequence.
  • Resource regeneration system for mana recovery.
  • State management system for tracking active effects.
  1. Combat Mechanics:
  • Damage calculation includes multiple defensive states.
  • Movement restrictions during channeling phases.
  • Automatic mana regeneration when not attacking.
  • Dynamic animation state updates.
  1. Code Architecture:
  • Modular design for easy integration into game systems.
  • Clear separation of movement, combat, and state management.
  • Efficient resource management system.
  • Comprehensive state tracking for animations and effects.
  1. Performance Considerations:
  • Optimized damage calculations for minimal overhead.
  • Efficient position updates using data classes.
  • Streamlined animation state management.
  • Minimal memory footprint for core attributes.
  1. Balancing Features:
  • Mana costs balanced against ability impact.
  • Movement speed tuned for tactical gameplay.
  • Defensive options require resource management.
  • Regeneration rates designed for sustained combat.

Leave a Reply

Your email address will not be published.

Fera-182: Open Source Character Code And SVG Preview
Previous Story

Fera-182: Open Source Character Code And SVG Preview

Hsoda 030: The Dual-Sword Wielding Warrior
Next Story

Hsoda 030: The Dual-Sword Wielding Warrior

Latest from APK

com spotify music apk arm64 v8a

com spotify music apk arm64 v8a: Safe Sources, Real Risks

If you only want the answer: com.spotify.music is the package name of the Spotify app on Android, the arm64-v8a label indicates that it’s the 64-bit version for modern phones. That’s the version that your phone is probably already using. To obtain it
ApkCort.co Is Gone — But the Fakes Aren't

ApkCort.co Is Gone — But the Fakes Aren’t

Quick version if you’re in a hurry: apkcort.co is dead — the site’s unreachable, nothing’s indexed, it’s just gone. Problem is, a bunch of copycat domains jumped on the name right after. Some look identical. Most are sketchy at best, outright dangerous
Jazzcash APk Download old versions

Mobilink Jazzcash APK + Older/All Versions

JazzCash JazzCash Customer Mobilink Pakistan 4.3 (456 Reviews) TRUSTED APP 503.4k Size 503.4k Installs 5.0+ Android DOWNLOAD v9.0.36 ✦ This is the latest version Homepage› Apps› Finance› JazzCash Customer Pakistan’s Leading Mobile Financial Services Platform JazzCash Customer is a fully fledged mobile
Fera-182: Open Source Character Code And SVG Preview
Previous Story

Fera-182: Open Source Character Code And SVG Preview

Hsoda 030: The Dual-Sword Wielding Warrior
Next Story

Hsoda 030: The Dual-Sword Wielding Warrior

Don't Miss

Top Mobile Games That Combine Fun with Brainpower

Top Mobile Games That Combine Fun with Brainpower

Gone are the days when mobile games were just mindless
What is Adobe Buzzwords

What are Adobe Buzzwords? Usage & Advantages

What are Adobe Buzzwords If you’re new to marketing, you