当前位置:网站首页>Teach you to quickly develop a werewolf killing wechat applet (with source code)
Teach you to quickly develop a werewolf killing wechat applet (with source code)
2022-04-23 12:52:00 【Java notes shrimp】
Click on the official account , utilize Fragment time to learn
One 、 Project presentation
Werewolf kill is a multiplayer , Promote... Through language description 、 Strategic desktop games that compete for eloquence and analytical judgment
The number of players is suitable for 4-18 Ginseng and
The main characters are : werewolf 、 prophet 、 Civilian 、 witch 、 The hunter 、 Idiot 、 The guards 、 Knight, etc

At the same time, there are many player images

Introduction to the functions of each role

Set the number of players and select the corresponding characters

Start the game

Two 、 home page
The home page is the page for selecting the number of games
Different numbers of people will be assigned different numbers of roles
Resident characters have werewolves 、 villager 、 prophet 、 witch 、 The hunter
When the number of players reaches 11 There will be Cupid
UI The code is as follows :
<!--index.wxml-->
<view class="container">
<view class="setting">
<image class="logo" src="{
{logo}}"></image>
<form action="">
<picker range="{
{array}}" value="{
{index}}" bindchange="gameNumberChange">
<text class="picker"> Select the number of games :</text>
<text wx:if="{
{array[index] < 10}}">{
{" " + array[index]}}</text>
<text wx:else>{
{array[index]}}</text>
</picker>
<view class="role-config" wx:for="{
{config}}">
<image class="role-logo" src="{
{item.role.logo}}"></image>
{
{item.role.name}} x {
{item.count}}
</view>
</form>
</view>
<button type="primary" bindtap="startGame"> Start the game </button>
</view>
The effect is as follows :

3、 ... and 、 Game page
Before entering the game interface , Players need to draw their own character cards
Then jump to the game interface
Part of the code of the role selection interface is as follows :
<view class="container">
<block wx:if="{
{isChoosing}}">
<view class="inner-container">
<view class="swiper-indicator">{
{swiperCurrent}}/{
{roles.length}}</view>
<swiper bindchange="swiperCurrentChange">
<block wx:for="{
{roles}}">
<swiper-item>
<view class="item-container">
<view class="side-space"></view>
<image src="{
{cover}}" class="cover"></image>
<view class="side-space"></view>
</view>
</swiper-item>
</block>
</swiper>
</view>
<button type="primary" bindtap="chooseRole"> Choose this card </button>
</block>
<block wx:else>
<view class="inner-container">
<view class="role-logo-container">
<image src="{
{choosedRole.logo}}" class="role-logo" animation="{
{roleLogoAnimationData}}"></image>
</view>
<view class="role-name"> Your role is : {
{choosedRole.name}}</view>
<view class="role-description">{
{choosedRole.description}}</view>
</view>
<button type="primary" bindtap="setReady"> Be on it </button>
</block>
</view>
Effect display :

After entering the game , There are multiple conversion links between day and night , Werewolves can knock out players in the dark
The effect is as follows :

Four 、 Special characters
The above effect is that of ordinary villagers and werewolves
among , The clergy have different skills
The first is the witch
The witch has two bottles of Medicine , A bottle of life-saving, a bottle of murder

The other is the Hunter
Hunters can kill one player in each round

Last
Download link ( need CSDN Integral ):
https://download.csdn.net/download/ws15168689087/83644749
source :https://blog.csdn.net/ws15168689087
recommend :
Main stream Java Advanced technology ( Learning material sharing )
PS: Because the official account platform changed the push rules. , If you don't want to miss the content , Remember to click after reading “ Looking at ”, Add one “ Star standard ”, In this way, each new article push will appear in your subscription list for the first time . spot “ Looking at ” Support us !
版权声明
本文为[Java notes shrimp]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231247138219.html
边栏推荐
- Ad20 supplementary note 3 - shortcut key + continuous update
- Please help me see what this is, mysql5 5. Thanks
- uni-app 原生APP-云打包集成极光推送(JG-JPUSH)详细教程
- Trier les principales utilisations de l'Agent IP réseau
- [unity note] basic lighting in l4unity
- ZigBee CC2530 minimum system and register configuration (1)
- SSL certificate refund instructions
- QT draw image
- STM32 control stepper motor (ULN2003 + 28byj)
- 5 free audio material websites, recommended collection
猜你喜欢
随机推荐
QT one process runs another
硬核解析Promise对象(这七个必会的常用API和七个关键问题你都了解吗?)
如何防止网站被黑客入侵篡改
MySQL函数-递归函数
解锁OpenHarmony技术日!年度盛会,即将揭幕!
Try the server for one month for free, and attach the tutorial
QT redraw events and cuts
How to prevent the website from being hacked and tampered with
Buuctf Web [gxyctf2019] no dolls
SSL证书退款说明
使用Source Insight查看编辑源代码
Packet capturing and sorting -- TCP protocol [8]
实现一个盒子在父盒子中水平垂直居中的几种“姿势”
精度、速度完美平衡,最新图像分割SOTA模型重磅发布!!!
Flash project cross domain interception and DBM database learning [Baotou cultural and creative website development]
Trier les principales utilisations de l'Agent IP réseau
C, calculation code of parameter points of two-dimensional Bezier curve
力扣刷题之完全二叉树的节点个数
Number of nodes of complete binary tree
软件测试周刊(第68期):解决棘手问题的最上乘方法是:静观其变,顺水推舟。