Skip to content

Commit

Permalink
Merge pull request #641 from JustOnesAndZeros/main
Browse files Browse the repository at this point in the history
added frog pet
  • Loading branch information
tonybaloney authored Jan 20, 2025
2 parents 1b91ecf + 1d5001c commit 819349d
Show file tree
Hide file tree
Showing 7 changed files with 101 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ The horse animations were adapted by [Chris Kent](https://github.com/thechrisken

[Kennet Shin](https://github.com/WoofWoof0) created the snail media assets.

The frog animations were created by [seethingswarm](https://seethingswarm.itch.io/frogpack).

[Jessie Ferris](https://github.com/jeferris) created the panda media assets.

## Thank you
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@
"cockatiel",
"dog",
"fox",
"frog",
"horse",
"mod",
"rat",
Expand Down
2 changes: 2 additions & 0 deletions src/common/names.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { CRAB_NAMES } from '../panel/pets/crab';
import { DENO_NAMES } from '../panel/pets/deno';
import { DOG_NAMES } from '../panel/pets/dog';
import { FOX_NAMES } from '../panel/pets/fox';
import { FROG_NAMES } from '../panel/pets/frog';
import { MOD_NAMES } from '../panel/pets/mod';
import { PANDA_NAMES } from '../panel/pets/panda';
import { ROCKY_NAMES } from '../panel/pets/rocky';
Expand All @@ -27,6 +28,7 @@ export function randomName(type: PetType): string {
[PetType.chicken]: CHICKEN_NAMES,
[PetType.dog]: DOG_NAMES,
[PetType.fox]: FOX_NAMES,
[PetType.frog]: FROG_NAMES,
[PetType.crab]: CRAB_NAMES,
[PetType.clippy]: CLIPPY_NAMES,
[PetType.deno]: DENO_NAMES,
Expand Down
3 changes: 3 additions & 0 deletions src/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export const enum PetColor {
lightbrown = 'lightbrown',
black = 'black',
green = 'green',
blue = 'blue',
yellow = 'yellow',
gray = 'gray',
purple = 'purple',
Expand Down Expand Up @@ -30,6 +31,7 @@ export const enum PetType {
dog = 'dog',
deno = 'deno',
fox = 'fox',
frog = 'frog',
horse = 'horse',
mod = 'mod',
panda = 'panda',
Expand Down Expand Up @@ -97,6 +99,7 @@ export const ALL_PETS = [
PetType.dog,
PetType.deno,
PetType.fox,
PetType.frog,
PetType.horse,
PetType.mod,
PetType.panda,
Expand Down
5 changes: 5 additions & 0 deletions src/panel/pets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Crab } from './pets/crab';
import { Deno } from './pets/deno';
import { Dog } from './pets/dog';
import { Fox } from './pets/fox';
import { Frog } from './pets/frog';
import { Horse } from './pets/horse';
import { Mod } from './pets/mod';
import { Panda } from './pets/panda';
Expand Down Expand Up @@ -207,6 +208,8 @@ export function createPet(
return new Dog(...standardPetArguments, PetSpeed.normal);
case PetType.fox:
return new Fox(...standardPetArguments, PetSpeed.fast);
case PetType.frog:
return new Frog(...standardPetArguments, PetSpeed.normal);
case PetType.crab:
return new Crab(...standardPetArguments, PetSpeed.slow);
case PetType.clippy:
Expand Down Expand Up @@ -252,6 +255,8 @@ export function availableColors(petType: PetType): PetColor[] {
return Deno.possibleColors;
case PetType.fox:
return Fox.possibleColors;
case PetType.frog:
return Frog.possibleColors;
case PetType.crab:
return Crab.possibleColors;
case PetType.clippy:
Expand Down
84 changes: 84 additions & 0 deletions src/panel/pets/frog.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
import { PetColor } from '../../common/types';
import { BasePetType } from '../basepettype';
import { States } from '../states';

export class Frog extends BasePetType {
label = 'frog';
static possibleColors = [PetColor.red, PetColor.green, PetColor.blue];
sequence = {
startingState: States.sitIdle,
sequenceStates: [
{
state: States.sitIdle,
possibleNextStates: [States.walkRight, States.runRight],
},
{
state: States.walkRight,
possibleNextStates: [States.walkLeft, States.runLeft],
},
{
state: States.runRight,
possibleNextStates: [States.walkLeft, States.runLeft],
},
{
state: States.walkLeft,
possibleNextStates: [States.sitIdle],
},
{
state: States.runLeft,
possibleNextStates: [States.sitIdle],
},
{
state: States.chase,
possibleNextStates: [States.idleWithBall],
},
{
state: States.idleWithBall,
possibleNextStates: [
States.walkRight,
States.walkLeft,
States.runLeft,
States.runRight,
],
},
],
};
get emoji(): string {
return '🐸';
}
get hello(): string {
return Math.random() > 0.5 ? `croak...` : `ribbit!`;
}
}

export const FROG_NAMES: ReadonlyArray<string> = [
'Blinky',
'Bubbles',
'Drift',
'Frogger',
'Freddy',
'Hopper',
'Jumpy',
'Kermit',
'Lily',
'Leapster',
'Marsh',
'Misty',
'Moss',
'Pebbles',
'Pip',
'Pondy',
'Quagmire',
'Rango',
'Razor',
'Slick',
'Swamper',
'Swampy',
'Sprout',
'Thistle',
'Tad',
'Toady',
'Warty',
'Willow',
'Wiggle',
];
4 changes: 4 additions & 0 deletions src/test/gifs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ const pets: { [key: string]: { colors: string[]; states: string[] } } = {
colors: ['red', 'white'],
states: ['idle', 'run', 'swipe', 'walk', 'walk_fast', 'with_ball'],
},
frog: {
colors: ['green'],
states: ['idle', 'run', 'swipe', 'walk', 'walk_fast', 'with_ball'],
},
mod: {
colors: ['purple'],
states: ['idle', 'run', 'swipe', 'walk', 'walk_fast', 'with_ball'],
Expand Down

0 comments on commit 819349d

Please sign in to comment.