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

Add a deno pet #567

Merged
merged 15 commits into from
Jun 11, 2024
Binary file added media/deno/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/deno/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/deno/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/deno/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/deno/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/deno/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.
2 changes: 2 additions & 0 deletions src/common/names.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { CHICKEN_NAMES } from '../panel/pets/chicken';
import { CLIPPY_NAMES } from '../panel/pets/clippy';
import { COCKATIEL_NAMES } from '../panel/pets/cockatiel';
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 { MOD_NAMES } from '../panel/pets/mod';
Expand All @@ -25,6 +26,7 @@ export function randomName(type: PetType): string {
[PetType.fox]: FOX_NAMES,
[PetType.crab]: CRAB_NAMES,
[PetType.clippy]: CLIPPY_NAMES,
[PetType.deno]: DENO_NAMES,
[PetType.mod]: MOD_NAMES,
[PetType.totoro]: TOTORO_NAMES,
[PetType.snake]: SNAKE_NAMES,
Expand Down
2 changes: 2 additions & 0 deletions src/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const enum PetType {
cockatiel = 'cockatiel',
crab = 'crab',
dog = 'dog',
deno = 'deno',
fox = 'fox',
mod = 'mod',
rat = 'rat',
Expand Down Expand Up @@ -83,6 +84,7 @@ export const ALL_PETS = [
PetType.cockatiel,
PetType.crab,
PetType.dog,
PetType.deno,
PetType.fox,
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 @@ -4,6 +4,7 @@ import { Chicken } from './pets/chicken';
import { Clippy } from './pets/clippy';
import { Cockatiel } from './pets/cockatiel';
import { Crab } from './pets/crab';
import { Deno } from './pets/deno';
import { Dog } from './pets/dog';
import { Fox } from './pets/fox';
import { Mod } from './pets/mod';
Expand Down Expand Up @@ -178,6 +179,8 @@ export function createPet(
return new Cat(...standardPetArguments, PetSpeed.normal);
case PetType.chicken:
return new Chicken(...standardPetArguments, PetSpeed.normal);
case PetType.deno:
return new Deno(...standardPetArguments, PetSpeed.slow);
case PetType.dog:
return new Dog(...standardPetArguments, PetSpeed.normal);
case PetType.fox:
Expand Down Expand Up @@ -217,6 +220,8 @@ export function availableColors(petType: PetType): PetColor[] {
return Chicken.possibleColors;
case PetType.dog:
return Dog.possibleColors;
case PetType.deno:
return Deno.possibleColors;
case PetType.fox:
return Fox.possibleColors;
case PetType.crab:
Expand Down
75 changes: 75 additions & 0 deletions src/panel/pets/deno.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import { PetColor } from '../../common/types';
import { BasePetType } from '../basepettype';
import { States } from '../states';

export class Deno extends BasePetType {
label = 'deno';
static possibleColors = [PetColor.green];
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,
States.walkRight,
States.runRight,
],
},
{
state: States.runLeft,
possibleNextStates: [
States.sitIdle,
States.walkRight,
States.runRight,
],
},
{
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 `I ❤️ TS`;
}
}

export const DENO_NAMES: ReadonlyArray<string> = [
'Dee',
'Dee Dee',
'Deno',
'Deno Jr.',
'Deno the Dino',
'Deploydocus',
'Dino',
'Dippy',
'Dr Deno',
'Herby',
'Littlefoot',
'Ry',
];
4 changes: 4 additions & 0 deletions src/test/gifs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ const pets: { [key: string]: { colors: string[]; states: string[] } } = {
colors: ['red'],
states: ['idle', 'run', 'swipe', 'walk', 'walk_fast', 'with_ball'],
},
deno: {
colors: ['green'],
states: ['idle', 'run', 'swipe', 'walk', 'with_ball'],
},
dog: {
colors: ['black', 'brown', 'red', 'white', 'akita'],
states: [
Expand Down
Loading