• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

mykeels/whot: A Game API for the Nigerian Whot Card Game. https://github.com/myk ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

mykeels/whot

开源软件地址:

https://github.com/mykeels/whot

开源编程语言:

JavaScript 100.0%

开源软件介绍:

Whot!

Whot! is the national card game of Nigeria. It is played by young and old, and has come to be associated with fond memories, by me and a lot of people I know. Read More

This is a JS Library that will facilitate the Nigerian Whot! Game Play.

Why

I have started this project because I hope someone else builds a beautiful UI/UX around it (cos I can't).

I also want to play this game with my friends and family from my phone and laptop, and experience the same amount of fun I did playing it as a child.

How

npm install whot
const Game = require('whot')

const game = new Game({
    noOfDecks: 1, //number of card decks to be used
    noOfPlayers: 4
})

You can subscribe to the events that the Game instance offers via its emitter property.

To play a card:

const player = game.turn.next()

if (player.canPlay()) {
    /** pick a random card from the player's hand */
    const compatibleCardIndex = player.hand()
                                .findIndex(card => card.matches(game.pile.top()))
    player.play(compatibleCardIndex)
    game.turn.execute(game.pile.top())
}
else {
    const marketCards = player.pick()
    game.turn.switch()
}

Read more in docs

Testing

Who

If you're interested, see the Contribution Guide.

When

On-going! Now on version 1.0.6


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap