diff --git a/Games/Pokemon_Adventure_Game/README.md b/Games/Pokemon_Adventure_Game/README.md new file mode 100644 index 0000000000..d17a7c3367 --- /dev/null +++ b/Games/Pokemon_Adventure_Game/README.md @@ -0,0 +1,54 @@ +# Pokemon Adventure Game + +Welcome to the 2D Pokemon Adventure Game! This project is a two-dimensional game where players can move a character, battle with a single Pokemon, and interact with various other characters. Dive into an exciting world filled with adventures, battles, and exploration. + +## Features + +### Player Movement +- Control the player character to move in four directions (up, down, left, right). +- Smooth animations for walking and running. +- Collision detection to prevent walking through obstacles. + +### Pokemon System +- A single Pokemon that belongs to the player. +- Ability for the Pokemon to battle other wild or trainer Pokemon. +- Health points (HP) and experience points (XP) system for the Pokemon. +- Leveling up and evolving the Pokemon based on XP. + +### Battle System +- Turn-based battle mechanics. +- A variety of moves and attacks for the Pokemon. +- Status effects (e.g., burn, poison, paralysis) that can be inflicted during battles. +- Winning battles grants XP and possibly items or currency. + +### Character Interactions +- Non-player characters (NPCs) scattered throughout the game world. +- Dialogues with NPCs, including quests or missions. +- NPCs that can challenge the player to battles. +- Friendly NPCs who can provide hints, items, or healing services. + +### Game World +- A detailed map with different areas to explore (towns, forests, caves, etc.). +- Interactive objects and items that can be found or collected. +- Visual and audio feedback for interactions and discoveries. + +### Graphics and UI +- 2D pixel art style for characters, Pokemon, and environment. +- Intuitive user interface for navigating menus, inventory, and battle options. +- Visual indicators for health, status effects, and XP. + +### Sound and Music +- Background music that changes based on the area or situation. +- Sound effects for movements, interactions, and battles. +- Voice snippets or sound cues for NPC dialogues and Pokemon cries. + +## Screenshots +![Screenshot from 2024-07-25 10-45-46](https://github.com/user-attachments/assets/88813192-18e8-4aa6-865e-01c616dd0ade) +![Screenshot from 2024-07-25 10-46-15](https://github.com/user-attachments/assets/2c6a2f6a-359b-454e-8d1f-ddde5585a218) + + +## Created by +- Name : Vaibhav Kesarwani +- Linkedin: https://www.linkedin.com/in/vaibhav-kesarwani-9b5b35252/ +- Github: https://github.com/Vaibhav-kesarwani +- Portfolio: https://vaibhavkesarwani.vercel.app/ \ No newline at end of file diff --git a/Games/Pokemon_Adventure_Game/audio/battle.mp3 b/Games/Pokemon_Adventure_Game/audio/battle.mp3 new file mode 100644 index 0000000000..f2018d63ae Binary files /dev/null and b/Games/Pokemon_Adventure_Game/audio/battle.mp3 differ diff --git a/Games/Pokemon_Adventure_Game/audio/fireballHit.wav b/Games/Pokemon_Adventure_Game/audio/fireballHit.wav new file mode 100644 index 0000000000..b5facdc268 Binary files /dev/null and b/Games/Pokemon_Adventure_Game/audio/fireballHit.wav differ diff --git a/Games/Pokemon_Adventure_Game/audio/initBattle.wav b/Games/Pokemon_Adventure_Game/audio/initBattle.wav new file mode 100644 index 0000000000..481d1ebe11 Binary files /dev/null and b/Games/Pokemon_Adventure_Game/audio/initBattle.wav differ diff --git a/Games/Pokemon_Adventure_Game/audio/initFireball.wav b/Games/Pokemon_Adventure_Game/audio/initFireball.wav new file mode 100644 index 0000000000..19c28eb706 Binary files /dev/null and b/Games/Pokemon_Adventure_Game/audio/initFireball.wav differ diff --git a/Games/Pokemon_Adventure_Game/audio/map.wav b/Games/Pokemon_Adventure_Game/audio/map.wav new file mode 100644 index 0000000000..ca27f875d3 Binary files /dev/null and b/Games/Pokemon_Adventure_Game/audio/map.wav differ diff --git a/Games/Pokemon_Adventure_Game/audio/tackleHit.wav b/Games/Pokemon_Adventure_Game/audio/tackleHit.wav new file mode 100644 index 0000000000..ced03936cd Binary files /dev/null and b/Games/Pokemon_Adventure_Game/audio/tackleHit.wav differ diff --git a/Games/Pokemon_Adventure_Game/audio/victory.wav b/Games/Pokemon_Adventure_Game/audio/victory.wav new file mode 100644 index 0000000000..2a19d56be2 Binary files /dev/null and b/Games/Pokemon_Adventure_Game/audio/victory.wav differ diff --git a/Games/Pokemon_Adventure_Game/battleScene.js b/Games/Pokemon_Adventure_Game/battleScene.js new file mode 100644 index 0000000000..1742a59cba --- /dev/null +++ b/Games/Pokemon_Adventure_Game/battleScene.js @@ -0,0 +1,135 @@ +const battleBackgroundImage = new Image() +battleBackgroundImage.src = './img/battleBackground.png' +const battleBackground = new Sprite({ + position: { + x: 0, + y: 0 + }, + image: battleBackgroundImage +}) + +let draggle +let emby +let renderedSprites +let battleAnimationId +let queue + +function initBattle() { + document.querySelector('#userInterface').style.display = 'block' + document.querySelector('#dialogueBox').style.display = 'none' + document.querySelector('#enemyHealthBar').style.width = '100%' + document.querySelector('#playerHealthBar').style.width = '100%' + document.querySelector('#attacksBox').replaceChildren() + + draggle = new Monster(monsters.Draggle) + emby = new Monster(monsters.Emby) + renderedSprites = [draggle, emby] + queue = [] + + emby.attacks.forEach((attack) => { + const button = document.createElement('button') + button.innerHTML = attack.name + document.querySelector('#attacksBox').append(button) + }) + + // our event listeners for our buttons (attack) + document.querySelectorAll('button').forEach((button) => { + button.addEventListener('click', (e) => { + const selectedAttack = attacks[e.currentTarget.innerHTML] + emby.attack({ + attack: selectedAttack, + recipient: draggle, + renderedSprites + }) + + if (draggle.health <= 0) { + queue.push(() => { + draggle.faint() + }) + queue.push(() => { + // fade back to black + gsap.to('#overlappingDiv', { + opacity: 1, + onComplete: () => { + cancelAnimationFrame(battleAnimationId) + animate() + document.querySelector('#userInterface').style.display = 'none' + + gsap.to('#overlappingDiv', { + opacity: 0 + }) + + battle.initiated = false + audio.Map.play() + } + }) + }) + } + + // draggle or enemy attacks right here + const randomAttack = + draggle.attacks[Math.floor(Math.random() * draggle.attacks.length)] + + queue.push(() => { + draggle.attack({ + attack: randomAttack, + recipient: emby, + renderedSprites + }) + + if (emby.health <= 0) { + queue.push(() => { + emby.faint() + }) + + queue.push(() => { + // fade back to black + gsap.to('#overlappingDiv', { + opacity: 1, + onComplete: () => { + cancelAnimationFrame(battleAnimationId) + animate() + document.querySelector('#userInterface').style.display = 'none' + + gsap.to('#overlappingDiv', { + opacity: 0 + }) + + battle.initiated = false + audio.Map.play() + } + }) + }) + } + }) + }) + + button.addEventListener('mouseenter', (e) => { + const selectedAttack = attacks[e.currentTarget.innerHTML] + document.querySelector('#attackType').innerHTML = selectedAttack.type + document.querySelector('#attackType').style.color = selectedAttack.color + }) + }) +} + +function animateBattle() { + battleAnimationId = window.requestAnimationFrame(animateBattle) + battleBackground.draw() + + console.log(battleAnimationId) + + renderedSprites.forEach((sprite) => { + sprite.draw() + }) +} + +animate() +// initBattle() +// animateBattle() + +document.querySelector('#dialogueBox').addEventListener('click', (e) => { + if (queue.length > 0) { + queue[0]() + queue.shift() + } else e.currentTarget.style.display = 'none' +}) diff --git a/Games/Pokemon_Adventure_Game/classes.js b/Games/Pokemon_Adventure_Game/classes.js new file mode 100644 index 0000000000..0bb9ece1f2 --- /dev/null +++ b/Games/Pokemon_Adventure_Game/classes.js @@ -0,0 +1,271 @@ +class Sprite { + constructor({ + position, + velocity, + image, + frames = { max: 1, hold: 10 }, + sprites, + animate = false, + rotation = 0, + scale = 1 + }) { + this.position = position + this.image = new Image() + this.frames = { ...frames, val: 0, elapsed: 0 } + this.image.onload = () => { + this.width = (this.image.width / this.frames.max) * scale + this.height = this.image.height * scale + } + this.image.src = image.src + + this.animate = animate + this.sprites = sprites + this.opacity = 1 + + this.rotation = rotation + this.scale = scale + } + + draw() { + c.save() + c.translate( + this.position.x + this.width / 2, + this.position.y + this.height / 2 + ) + c.rotate(this.rotation) + c.translate( + -this.position.x - this.width / 2, + -this.position.y - this.height / 2 + ) + c.globalAlpha = this.opacity + + const crop = { + position: { + x: this.frames.val * (this.width / this.scale), + y: 0 + }, + width: this.image.width / this.frames.max, + height: this.image.height + } + + const image = { + position: { + x: this.position.x, + y: this.position.y + }, + width: this.image.width / this.frames.max, + height: this.image.height + } + + c.drawImage( + this.image, + crop.position.x, + crop.position.y, + crop.width, + crop.height, + image.position.x, + image.position.y, + image.width * this.scale, + image.height * this.scale + ) + + c.restore() + + if (!this.animate) return + + if (this.frames.max > 1) { + this.frames.elapsed++ + } + + if (this.frames.elapsed % this.frames.hold === 0) { + if (this.frames.val < this.frames.max - 1) this.frames.val++ + else this.frames.val = 0 + } + } +} + +class Monster extends Sprite { + constructor({ + position, + velocity, + image, + frames = { max: 1, hold: 10 }, + sprites, + animate = false, + rotation = 0, + isEnemy = false, + name, + attacks + }) { + super({ + position, + velocity, + image, + frames, + sprites, + animate, + rotation + }) + this.health = 100 + this.isEnemy = isEnemy + this.name = name + this.attacks = attacks + } + + faint() { + document.querySelector('#dialogueBox').innerHTML = this.name + ' fainted!' + gsap.to(this.position, { + y: this.position.y + 20 + }) + gsap.to(this, { + opacity: 0 + }) + audio.battle.stop() + audio.victory.play() + } + + attack({ attack, recipient, renderedSprites }) { + document.querySelector('#dialogueBox').style.display = 'block' + document.querySelector('#dialogueBox').innerHTML = + this.name + ' used ' + attack.name + + let healthBar = '#enemyHealthBar' + if (this.isEnemy) healthBar = '#playerHealthBar' + + let rotation = 1 + if (this.isEnemy) rotation = -2.2 + + recipient.health -= attack.damage + + switch (attack.name) { + case 'Fireball': + audio.initFireball.play() + const fireballImage = new Image() + fireballImage.src = './img/fireball.png' + const fireball = new Sprite({ + position: { + x: this.position.x, + y: this.position.y + }, + image: fireballImage, + frames: { + max: 4, + hold: 10 + }, + animate: true, + rotation + }) + renderedSprites.splice(1, 0, fireball) + + gsap.to(fireball.position, { + x: recipient.position.x, + y: recipient.position.y, + onComplete: () => { + // Enemy actually gets hit + audio.fireballHit.play() + gsap.to(healthBar, { + width: recipient.health + '%' + }) + + gsap.to(recipient.position, { + x: recipient.position.x + 10, + yoyo: true, + repeat: 5, + duration: 0.08 + }) + + gsap.to(recipient, { + opacity: 0, + repeat: 5, + yoyo: true, + duration: 0.08 + }) + renderedSprites.splice(1, 1) + } + }) + + break + case 'Tackle': + const tl = gsap.timeline() + + let movementDistance = 20 + if (this.isEnemy) movementDistance = -20 + + tl.to(this.position, { + x: this.position.x - movementDistance + }) + .to(this.position, { + x: this.position.x + movementDistance * 2, + duration: 0.1, + onComplete: () => { + // Enemy actually gets hit + audio.tackleHit.play() + gsap.to(healthBar, { + width: recipient.health + '%' + }) + + gsap.to(recipient.position, { + x: recipient.position.x + 10, + yoyo: true, + repeat: 5, + duration: 0.08 + }) + + gsap.to(recipient, { + opacity: 0, + repeat: 5, + yoyo: true, + duration: 0.08 + }) + } + }) + .to(this.position, { + x: this.position.x + }) + break + } + } +} + +class Boundary { + static width = 48 + static height = 48 + constructor({ position }) { + this.position = position + this.width = 48 + this.height = 48 + } + + draw() { + c.fillStyle = 'rgba(255, 0, 0, 0)' + c.fillRect(this.position.x, this.position.y, this.width, this.height) + } +} + +class Character extends Sprite { + constructor({ + position, + velocity, + image, + frames = { max: 1, hold: 10 }, + sprites, + animate = false, + rotation = 0, + scale = 1, + dialogue = [''] + }) { + super({ + position, + velocity, + image, + frames, + sprites, + animate, + rotation, + scale + }) + + this.dialogue = dialogue + this.dialogueIndex = 0 + } +} diff --git a/Games/Pokemon_Adventure_Game/data/attacks.js b/Games/Pokemon_Adventure_Game/data/attacks.js new file mode 100644 index 0000000000..51f4002eee --- /dev/null +++ b/Games/Pokemon_Adventure_Game/data/attacks.js @@ -0,0 +1,14 @@ +const attacks = { + Tackle: { + name: 'Tackle', + damage: 10, + type: 'Normal', + color: 'black' + }, + Fireball: { + name: 'Fireball', + damage: 25, + type: 'Fire', + color: 'red' + } +} diff --git a/Games/Pokemon_Adventure_Game/data/audio.js b/Games/Pokemon_Adventure_Game/data/audio.js new file mode 100644 index 0000000000..3eacc1899f --- /dev/null +++ b/Games/Pokemon_Adventure_Game/data/audio.js @@ -0,0 +1,37 @@ +const audio = { + Map: new Howl({ + src: './audio/map.wav', + html5: true, + volume: 0.1 + }), + initBattle: new Howl({ + src: './audio/initBattle.wav', + html5: true, + volume: 0.1 + }), + battle: new Howl({ + src: './audio/battle.mp3', + html5: true, + volume: 0.1 + }), + tackleHit: new Howl({ + src: './audio/tackleHit.wav', + html5: true, + volume: 0.1 + }), + fireballHit: new Howl({ + src: './audio/fireballHit.wav', + html5: true, + volume: 0.1 + }), + initFireball: new Howl({ + src: './audio/initFireball.wav', + html5: true, + volume: 0.1 + }), + victory: new Howl({ + src: './audio/victory.wav', + html5: true, + volume: 0.1 + }) +} diff --git a/Games/Pokemon_Adventure_Game/data/battleZones.js b/Games/Pokemon_Adventure_Game/data/battleZones.js new file mode 100644 index 0000000000..687ca48003 --- /dev/null +++ b/Games/Pokemon_Adventure_Game/data/battleZones.js @@ -0,0 +1,2802 @@ +const battleZonesData = [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1025, + 1025, + 1025, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1025, + 1025, + 1025, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1025, + 1025, + 1025, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1025, + 1025, + 1025, + 1025, + 1025, + 1025, + 1025, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1025, + 1025, + 1025, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1025, + 1025, + 1025, + 1025, + 1025, + 1025, + 1025, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 +] diff --git a/Games/Pokemon_Adventure_Game/data/characters.js b/Games/Pokemon_Adventure_Game/data/characters.js new file mode 100644 index 0000000000..538027b474 --- /dev/null +++ b/Games/Pokemon_Adventure_Game/data/characters.js @@ -0,0 +1,110 @@ +const charactersMapData = [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0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0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +] diff --git a/Games/Pokemon_Adventure_Game/data/collisions.js b/Games/Pokemon_Adventure_Game/data/collisions.js new file mode 100644 index 0000000000..d1ee664543 --- /dev/null +++ b/Games/Pokemon_Adventure_Game/data/collisions.js @@ -0,0 +1 @@ +const collisions = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1025, 1025, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1025, 1025, 0, 0, 0, 0, 1025, 1025, 1025, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1025, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1025, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1025, 1025, 0, 1025, 1025, 1025, 1025, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1025, 1025, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1025, 0, 0, 1025, 1025, 1025, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1025, 1025, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1025, 1025, 0, 0, 1025, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1025, 1025, 0, 0, 0, 1025, 1025, 1025, 1025, 1025, 0, 1025, 1025, 1025, 0, 1025, 1025, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1025, 0, 1025, 1025, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1025, 0, 0, 0, 1025, 0, 0, 0, 1025, 1025, 1025, 1025, 1025, 1025, 1025, 1025, 0, 1025, 0, 0,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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] \ No newline at end of file diff --git a/Games/Pokemon_Adventure_Game/data/monsters.js b/Games/Pokemon_Adventure_Game/data/monsters.js new file mode 100644 index 0000000000..a65d7ca9dc --- /dev/null +++ b/Games/Pokemon_Adventure_Game/data/monsters.js @@ -0,0 +1,35 @@ +const monsters = { + Emby: { + position: { + x: 280, + y: 325 + }, + image: { + src: './img/embySprite.png' + }, + frames: { + max: 4, + hold: 30 + }, + animate: true, + name: 'Emby', + attacks: [attacks.Tackle, attacks.Fireball] + }, + Draggle: { + position: { + x: 800, + y: 100 + }, + image: { + src: './img/draggleSprite.png' + }, + frames: { + max: 4, + hold: 30 + }, + animate: true, + isEnemy: true, + name: 'Draggle', + attacks: [attacks.Tackle, attacks.Fireball] + } +} diff --git a/Games/Pokemon_Adventure_Game/img/Pellet Town.png b/Games/Pokemon_Adventure_Game/img/Pellet Town.png new file mode 100644 index 0000000000..fe2536b4a5 Binary files /dev/null and b/Games/Pokemon_Adventure_Game/img/Pellet Town.png differ diff --git a/Games/Pokemon_Adventure_Game/img/battleBackground.png b/Games/Pokemon_Adventure_Game/img/battleBackground.png new file mode 100644 index 0000000000..7f8d79483b Binary files /dev/null and b/Games/Pokemon_Adventure_Game/img/battleBackground.png differ diff --git a/Games/Pokemon_Adventure_Game/img/draggleSprite.png b/Games/Pokemon_Adventure_Game/img/draggleSprite.png new file mode 100644 index 0000000000..89e31e09c6 Binary files /dev/null and b/Games/Pokemon_Adventure_Game/img/draggleSprite.png differ diff --git a/Games/Pokemon_Adventure_Game/img/embySprite.png b/Games/Pokemon_Adventure_Game/img/embySprite.png new file mode 100644 index 0000000000..d8a9940c4d Binary files /dev/null and b/Games/Pokemon_Adventure_Game/img/embySprite.png differ diff --git a/Games/Pokemon_Adventure_Game/img/fireball.png b/Games/Pokemon_Adventure_Game/img/fireball.png new file mode 100644 index 0000000000..1a151a95b2 Binary files /dev/null and b/Games/Pokemon_Adventure_Game/img/fireball.png differ diff --git a/Games/Pokemon_Adventure_Game/img/foregroundObjects.png b/Games/Pokemon_Adventure_Game/img/foregroundObjects.png new file mode 100644 index 0000000000..86f1727ad6 Binary files /dev/null and b/Games/Pokemon_Adventure_Game/img/foregroundObjects.png differ diff --git a/Games/Pokemon_Adventure_Game/img/oldMan/Idle.png b/Games/Pokemon_Adventure_Game/img/oldMan/Idle.png new file mode 100644 index 0000000000..ec69028d8b Binary files /dev/null and b/Games/Pokemon_Adventure_Game/img/oldMan/Idle.png differ diff --git a/Games/Pokemon_Adventure_Game/img/playerDown.png b/Games/Pokemon_Adventure_Game/img/playerDown.png new file mode 100644 index 0000000000..bfb8b65e2b Binary files /dev/null and b/Games/Pokemon_Adventure_Game/img/playerDown.png differ diff --git a/Games/Pokemon_Adventure_Game/img/playerLeft.png b/Games/Pokemon_Adventure_Game/img/playerLeft.png new file mode 100644 index 0000000000..bf74bd3bb2 Binary files /dev/null and b/Games/Pokemon_Adventure_Game/img/playerLeft.png differ diff --git a/Games/Pokemon_Adventure_Game/img/playerRight.png b/Games/Pokemon_Adventure_Game/img/playerRight.png new file mode 100644 index 0000000000..524cb1a709 Binary files /dev/null and b/Games/Pokemon_Adventure_Game/img/playerRight.png differ diff --git a/Games/Pokemon_Adventure_Game/img/playerUp.png b/Games/Pokemon_Adventure_Game/img/playerUp.png new file mode 100644 index 0000000000..cc7f2dc4ab Binary files /dev/null and b/Games/Pokemon_Adventure_Game/img/playerUp.png differ diff --git a/Games/Pokemon_Adventure_Game/img/villager/Idle.png b/Games/Pokemon_Adventure_Game/img/villager/Idle.png new file mode 100644 index 0000000000..8e59a4eb13 Binary files /dev/null and b/Games/Pokemon_Adventure_Game/img/villager/Idle.png differ diff --git a/Games/Pokemon_Adventure_Game/index.html b/Games/Pokemon_Adventure_Game/index.html new file mode 100644 index 0000000000..21d5fd81e7 --- /dev/null +++ b/Games/Pokemon_Adventure_Game/index.html @@ -0,0 +1,200 @@ + + + + + + + +
+
+ + +
+ + +
+ + + + + + + + + + + + diff --git a/Games/Pokemon_Adventure_Game/index.js b/Games/Pokemon_Adventure_Game/index.js new file mode 100644 index 0000000000..bf90f4f013 --- /dev/null +++ b/Games/Pokemon_Adventure_Game/index.js @@ -0,0 +1,488 @@ +const canvas = document.querySelector('canvas') +const c = canvas.getContext('2d') + +canvas.width = 1024 +canvas.height = 576 + +const collisionsMap = [] +for (let i = 0; i < collisions.length; i += 70) { + collisionsMap.push(collisions.slice(i, 70 + i)) +} + +const battleZonesMap = [] +for (let i = 0; i < battleZonesData.length; i += 70) { + battleZonesMap.push(battleZonesData.slice(i, 70 + i)) +} + +const charactersMap = [] +for (let i = 0; i < charactersMapData.length; i += 70) { + charactersMap.push(charactersMapData.slice(i, 70 + i)) +} +console.log(charactersMap) + +const boundaries = [] +const offset = { + x: -735, + y: -650 +} + +collisionsMap.forEach((row, i) => { + row.forEach((symbol, j) => { + if (symbol === 1025) + boundaries.push( + new Boundary({ + position: { + x: j * Boundary.width + offset.x, + y: i * Boundary.height + offset.y + } + }) + ) + }) +}) + +const battleZones = [] + +battleZonesMap.forEach((row, i) => { + row.forEach((symbol, j) => { + if (symbol === 1025) + battleZones.push( + new Boundary({ + position: { + x: j * Boundary.width + offset.x, + y: i * Boundary.height + offset.y + } + }) + ) + }) +}) + +const characters = [] +const villagerImg = new Image() +villagerImg.src = './img/villager/Idle.png' + +const oldManImg = new Image() +oldManImg.src = './img/oldMan/Idle.png' + +charactersMap.forEach((row, i) => { + row.forEach((symbol, j) => { + // 1026 === villager + if (symbol === 1026) { + characters.push( + new Character({ + position: { + x: j * Boundary.width + offset.x, + y: i * Boundary.height + offset.y + }, + image: villagerImg, + frames: { + max: 4, + hold: 60 + }, + scale: 3, + animate: true, + dialogue: ['...', 'Hey mister, have you seen my Doggochu?'] + }) + ) + } + // 1031 === oldMan + else if (symbol === 1031) { + characters.push( + new Character({ + position: { + x: j * Boundary.width + offset.x, + y: i * Boundary.height + offset.y + }, + image: oldManImg, + frames: { + max: 4, + hold: 60 + }, + scale: 3, + dialogue: ['My bones hurt.'] + }) + ) + } + + if (symbol !== 0) { + boundaries.push( + new Boundary({ + position: { + x: j * Boundary.width + offset.x, + y: i * Boundary.height + offset.y + } + }) + ) + } + }) +}) + +const image = new Image() +image.src = './img/Pellet Town.png' + +const foregroundImage = new Image() +foregroundImage.src = './img/foregroundObjects.png' + +const playerDownImage = new Image() +playerDownImage.src = './img/playerDown.png' + +const playerUpImage = new Image() +playerUpImage.src = './img/playerUp.png' + +const playerLeftImage = new Image() +playerLeftImage.src = './img/playerLeft.png' + +const playerRightImage = new Image() +playerRightImage.src = './img/playerRight.png' + +const player = new Sprite({ + position: { + x: canvas.width / 2 - 192 / 4 / 2, + y: canvas.height / 2 - 68 / 2 + }, + image: playerDownImage, + frames: { + max: 4, + hold: 10 + }, + sprites: { + up: playerUpImage, + left: playerLeftImage, + right: playerRightImage, + down: playerDownImage + } +}) + +const background = new Sprite({ + position: { + x: offset.x, + y: offset.y + }, + image: image +}) + +const foreground = new Sprite({ + position: { + x: offset.x, + y: offset.y + }, + image: foregroundImage +}) + +const keys = { + w: { + pressed: false + }, + a: { + pressed: false + }, + s: { + pressed: false + }, + d: { + pressed: false + } +} + +const movables = [ + background, + ...boundaries, + foreground, + ...battleZones, + ...characters +] +const renderables = [ + background, + ...boundaries, + ...battleZones, + ...characters, + player, + foreground +] + +const battle = { + initiated: false +} + +function animate() { + const animationId = window.requestAnimationFrame(animate) + renderables.forEach((renderable) => { + renderable.draw() + }) + + let moving = true + player.animate = false + + if (battle.initiated) return + + // activate a battle + if (keys.w.pressed || keys.a.pressed || keys.s.pressed || keys.d.pressed) { + for (let i = 0; i < battleZones.length; i++) { + const battleZone = battleZones[i] + const overlappingArea = + (Math.min( + player.position.x + player.width, + battleZone.position.x + battleZone.width + ) - + Math.max(player.position.x, battleZone.position.x)) * + (Math.min( + player.position.y + player.height, + battleZone.position.y + battleZone.height + ) - + Math.max(player.position.y, battleZone.position.y)) + if ( + rectangularCollision({ + rectangle1: player, + rectangle2: battleZone + }) && + overlappingArea > (player.width * player.height) / 2 && + Math.random() < 0.01 + ) { + // deactivate current animation loop + window.cancelAnimationFrame(animationId) + + audio.Map.stop() + audio.initBattle.play() + audio.battle.play() + + battle.initiated = true + gsap.to('#overlappingDiv', { + opacity: 1, + repeat: 3, + yoyo: true, + duration: 0.4, + onComplete() { + gsap.to('#overlappingDiv', { + opacity: 1, + duration: 0.4, + onComplete() { + // activate a new animation loop + initBattle() + animateBattle() + gsap.to('#overlappingDiv', { + opacity: 0, + duration: 0.4 + }) + } + }) + } + }) + break + } + } + } + + if (keys.w.pressed && lastKey === 'w') { + player.animate = true + player.image = player.sprites.up + + checkForCharacterCollision({ + characters, + player, + characterOffset: { x: 0, y: 3 } + }) + + for (let i = 0; i < boundaries.length; i++) { + const boundary = boundaries[i] + if ( + rectangularCollision({ + rectangle1: player, + rectangle2: { + ...boundary, + position: { + x: boundary.position.x, + y: boundary.position.y + 3 + } + } + }) + ) { + moving = false + break + } + } + + if (moving) + movables.forEach((movable) => { + movable.position.y += 3 + }) + } else if (keys.a.pressed && lastKey === 'a') { + player.animate = true + player.image = player.sprites.left + + checkForCharacterCollision({ + characters, + player, + characterOffset: { x: 3, y: 0 } + }) + + for (let i = 0; i < boundaries.length; i++) { + const boundary = boundaries[i] + if ( + rectangularCollision({ + rectangle1: player, + rectangle2: { + ...boundary, + position: { + x: boundary.position.x + 3, + y: boundary.position.y + } + } + }) + ) { + moving = false + break + } + } + + if (moving) + movables.forEach((movable) => { + movable.position.x += 3 + }) + } else if (keys.s.pressed && lastKey === 's') { + player.animate = true + player.image = player.sprites.down + + checkForCharacterCollision({ + characters, + player, + characterOffset: { x: 0, y: -3 } + }) + + for (let i = 0; i < boundaries.length; i++) { + const boundary = boundaries[i] + if ( + rectangularCollision({ + rectangle1: player, + rectangle2: { + ...boundary, + position: { + x: boundary.position.x, + y: boundary.position.y - 3 + } + } + }) + ) { + moving = false + break + } + } + + if (moving) + movables.forEach((movable) => { + movable.position.y -= 3 + }) + } else if (keys.d.pressed && lastKey === 'd') { + player.animate = true + player.image = player.sprites.right + + checkForCharacterCollision({ + characters, + player, + characterOffset: { x: -3, y: 0 } + }) + + for (let i = 0; i < boundaries.length; i++) { + const boundary = boundaries[i] + if ( + rectangularCollision({ + rectangle1: player, + rectangle2: { + ...boundary, + position: { + x: boundary.position.x - 3, + y: boundary.position.y + } + } + }) + ) { + moving = false + break + } + } + + if (moving) + movables.forEach((movable) => { + movable.position.x -= 3 + }) + } +} +// animate() + +let lastKey = '' +window.addEventListener('keydown', (e) => { + if (player.isInteracting) { + switch (e.key) { + case ' ': + player.interactionAsset.dialogueIndex++ + + const { dialogueIndex, dialogue } = player.interactionAsset + if (dialogueIndex <= dialogue.length - 1) { + document.querySelector('#characterDialogueBox').innerHTML = + player.interactionAsset.dialogue[dialogueIndex] + return + } + + // finish conversation + player.isInteracting = false + player.interactionAsset.dialogueIndex = 0 + document.querySelector('#characterDialogueBox').style.display = 'none' + + break + } + return + } + + switch (e.key) { + case ' ': + if (!player.interactionAsset) return + + // beginning the conversation + const firstMessage = player.interactionAsset.dialogue[0] + document.querySelector('#characterDialogueBox').innerHTML = firstMessage + document.querySelector('#characterDialogueBox').style.display = 'flex' + player.isInteracting = true + break + case 'w': + keys.w.pressed = true + lastKey = 'w' + break + case 'a': + keys.a.pressed = true + lastKey = 'a' + break + + case 's': + keys.s.pressed = true + lastKey = 's' + break + + case 'd': + keys.d.pressed = true + lastKey = 'd' + break + } +}) + +window.addEventListener('keyup', (e) => { + switch (e.key) { + case 'w': + keys.w.pressed = false + break + case 'a': + keys.a.pressed = false + break + case 's': + keys.s.pressed = false + break + case 'd': + keys.d.pressed = false + break + } +}) + +let clicked = false +addEventListener('click', () => { + if (!clicked) { + audio.Map.play() + clicked = true + } +}) diff --git a/Games/Pokemon_Adventure_Game/js/utils.js b/Games/Pokemon_Adventure_Game/js/utils.js new file mode 100644 index 0000000000..c860e1708f --- /dev/null +++ b/Games/Pokemon_Adventure_Game/js/utils.js @@ -0,0 +1,36 @@ +function rectangularCollision({ rectangle1, rectangle2 }) { + return ( + rectangle1.position.x + rectangle1.width >= rectangle2.position.x && + rectangle1.position.x <= rectangle2.position.x + rectangle2.width && + rectangle1.position.y <= rectangle2.position.y + rectangle2.height && + rectangle1.position.y + rectangle1.height >= rectangle2.position.y + ) +} + +function checkForCharacterCollision({ + characters, + player, + characterOffset = { x: 0, y: 0 } +}) { + player.interactionAsset = null + // monitor for character collision + for (let i = 0; i < characters.length; i++) { + const character = characters[i] + + if ( + rectangularCollision({ + rectangle1: player, + rectangle2: { + ...character, + position: { + x: character.position.x + characterOffset.x, + y: character.position.y + characterOffset.y + } + } + }) + ) { + player.interactionAsset = character + break + } + } +} diff --git a/README.md b/README.md index 7a1cf1b4f5..8a674d2e7f 100644 --- a/README.md +++ b/README.md @@ -1313,6 +1313,8 @@ This repository also provides one such platforms where contributers come over an |[Hangman_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Hangman_Game)| +|[Pokemon_Adventure_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Pokemon_Adventure_Game)| +
diff --git a/assets/images/Pokemon_Adventure_Game.webp b/assets/images/Pokemon_Adventure_Game.webp new file mode 100644 index 0000000000..9c3877f99c Binary files /dev/null and b/assets/images/Pokemon_Adventure_Game.webp differ diff --git a/assets/js/gamesData.json b/assets/js/gamesData.json index 760343aca1..2118280da7 100644 --- a/assets/js/gamesData.json +++ b/assets/js/gamesData.json @@ -3155,5 +3155,10 @@ "gameTitle" : "Hangman Game", "gameUrl": "Hangman_Game", "thumbnailUrl": "Hangman_Game.png" + }, + "630":{ + "gameTitle" : "Pokemon Adventure Game", + "gameUrl": "Pokemon_Adventure_Game", + "thumbnailUrl": "Pokemon_Adventure_Game.webp" } }