npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-boo-bash

v0.0.8

Published

VueBooBash is a lightweight and straightforward game that can be seamlessly integrated as an easter egg into your projects. It features a simple ghost animation that spawns and moves around the screen.

Downloads

8

Readme

VueBooBash 👻

VueBooBash is a lightweight and straightforward game that can be seamlessly integrated as an easter egg into your projects. It features a simple ghost animation that spawns and moves around the screen.

Download 🚀

VueBooBash is available on npm. You can install it using npm, yarn, or pnpm:

# Using npm
npm install vue-boo-bash

# Using yarn
yarn add vue-boo-bash

# Using pnpm
pnpm add vue-boo-bash

Usage 🎲

To incorporate VueBooBash into your project, import the BooBash component and its accompanying CSS styles:

<script setup lang="ts">
import { BooBash } from 'vue-boo-bash'
import 'vue-boo-bash/style.css'
</script>

<template>
    <!-- Simplest configuration -->
    <BooBash />
</template>

Background music 🎧

To reduce the size of the game's import, the background music can be imported separately. If you do not take any action, no music will play. The following example demonstrates how to import and utilize the background music.

<script setup lang="ts">
import { BooBash } from 'vue-boo-bash'
import 'vue-boo-bash/style.css'
import BackgroundMusic from 'vue-boo-bash/Ghost_House_Orchestral_Cover.mp3'

const settings = {
    music: BackgroundMusic // specify source for background music
}
</script>

<template>
    <BooBash :settings="settings" />
</template>

Muting Customization 🔇

You have the option to display a mute button, which mutes both the background music and sound effects. To display the button, you simply need to pass a parameter to the settings object. Alternatively, you can create your own method for muting the game. To do so, you only need to modify a different value of the settings object. Both values are reactive.

<script setup lang="ts">
const settings = {
    mute: true, // muting the game - optional, default false
    showMuteButton: true // optional, default false
}
</script>

<template>
    <BooBash :settings="settings" />
</template>

Customization 🎨

You can customize the scoreboard and game-over screen by utilizing optional slots:

<template>
    <BooBash>
        <!-- Scoreboard slot is optional -->
        <template #scoreboard="{ score, time, running }">
            <div v-if="running" class="own-styling">
                <h1>Scoreboard</h1>
                <p>Your score: {{ score }}</p>
                <p>Time left: {{ time }}</p>
            </div>
        </template>

        <!-- Game Over slot is optional -->
        <template #gameOver="{ score, highScore, show, closeGameOver }">
            <div v-if="show" class="own-styling">
                <h1>Game Over</h1>
                <p>Your score: {{ score }}</p>
                <p>High Score: {{ highScore }}</p>

                <button @click="closeGameOver">Close</button>
            </div>
        </template>
    </BooBash>
</template>

Optional Settings ⚙️

You can tweak game settings using an optional reactive settings object:

<script setup lang="ts">
import { ref } from 'vue'
import BackgroundMusic from '@/assets/my_music.mp3'

// Optional settings
const settings = ref({
    maxGameTime: 30, // Default: 30 seconds
    maxGhosts: 10, // Default: 10 ghosts
    spawnDuration: 2000, // Default: 2000 ms
    music: BackgroundMusic, // Background music source - default: nothing set
    mute: true, // Muting the game - default: false
    showMuteButton: true, // Showing default mute button - default: false
    debug: true // Display destination boxes on ghosts (for debugging)
})
</script>

<template>
    <BooBash :settings="settings" />
</template>

Optional Events 🎉

You can listen for various events such as new-game and game-over:

<script setup lang="ts">
// Event handler for a new game
const newGame = () => {
    console.log('New game')
}

// Event handler for game over
const gameOver = (event: { score: number; highScore: number }) => {
    console.log('Game over', event)
}
</script>

<template>
    <BooBash @new-game="newGame" @game-over="gameOver" />
</template>

Credits 🙌

Feel free to adjust any details according to your preferences or specific requirements.