Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added frog pet #641

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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).

## Thank you

Thanks to all the [contributors](https://github.com/tonybaloney/vscode-pets/graphs/contributors) to this project.
Binary file added media/frog/blue_idle_8fps.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/frog/blue_run_8fps.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/frog/blue_swipe_8fps.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/frog/blue_walk_8fps.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/frog/blue_walk_fast_8fps.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/frog/blue_with_ball_8fps.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/frog/green_idle_8fps.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/frog/green_run_8fps.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/frog/green_swipe_8fps.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/frog/green_walk_8fps.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/frog/green_walk_fast_8fps.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/frog/green_with_ball_8fps.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/frog/red_idle_8fps.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/frog/red_run_8fps.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/frog/red_swipe_8fps.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/frog/red_walk_8fps.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/frog/red_walk_fast_8fps.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/frog/red_with_ball_8fps.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 { ROCKY_NAMES } from '../panel/pets/rocky';
import { DUCK_NAMES } from '../panel/pets/rubberduck';
Expand All @@ -26,6 +27,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',
rat = 'rat',
Expand Down Expand Up @@ -96,6 +98,7 @@ export const ALL_PETS = [
PetType.dog,
PetType.deno,
PetType.fox,
PetType.frog,
PetType.horse,
PetType.mod,
PetType.rat,
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 { Rat } from './pets/rat';
Expand Down Expand Up @@ -187,6 +188,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 @@ -230,6 +233,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