


The method of developing and implementing the 2048 game on WeChat public platform
The details are as follows:
1. Overview of 2048 Game
"2048" is a popular digital game. The original version of 2048 was first released on github. The original author is Gabriele Cirulli. It is a new digital game developed based on the gameplay of "1024" and "Little 3 Legend".
Subsequently, various versions of 2048 appeared on various major platforms. The version ported to iOS by Ketchapp is the most popular, with about 10 million downloads now, and its name is exactly the same as the original version. The most famous of the derivative versions is the "2048 Hexagon" version, which has ranked among the top 200 board games in 81 countries around the world. The very popular Android version is "Challenge 2048", which has added two-player battles since version 2.0.0. The second, more special one is the 2048 Chinese Dynasty Edition. There is also a 2048 customized version, where you can define your own text and pictures. "2048" is a popular one on iOS.
HOW TO PLAY:Use yourarrow keys to move the tiles. When two tiles with the same number touch, theymerge into one!
NOTE:This site is the official version of 2048. You can play it on your phone via.All other apps or sites are derivatives or fakes, and should be used with caution.
Created by Gabriele Cirulli.Based on 1024 by Veewo Studioand conceptually similar to Threes by Ashe Vollmer.
The game rules are very simple. You can choose one of the up, down, left, or right directions to slide each time. Every time you slide, all the number squares will move closer to the sliding direction. The system will also randomly appear a number square in the blank space. The same Numbered squares will add up when they come close to each other and collide. The number cubes given by the system are either 2 or 4. Players have to find a way to make up the number cube "2048" in this small 16-frame range.
The screen of the game is very simple. At the beginning, most of the 16 squares are gray. When the player appears in the puzzle, the color will change. The overall style is very simple.
The gameplay rules are also very simple. At the beginning, two small numbers, such as 2 or 4, will appear in the square. Players only need to move the appearing numbers in one direction, up, down, left, or right, and all the numbers will slide in the direction. The direction is closer, and a number will appear randomly in the blank square that slides out. When the same numbers collide, they will be superimposed and moved closer. And then it will continue like this. The number 2048 will be pieced together after continuous superposition, which is considered successful.
If you are a numbers enthusiast, or a relatively talented math genius, you will be fascinated by it as soon as you get started. Even if you are not a math genius, ordinary players can play this game. If you are interested, download it and experience it.
Currently this game is open source, so there is no need to re-develop it
2. WeChat public platform
Put the 2048 source code on your own server and get the game url.
When the user follows, the user will be prompted to reply 2048 to play this game,
When the user replies to 2048, reply with a picture and text message with a 2048 game link in the picture and text.
The complete code is shown below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
/* 方倍工作室 CopyRight 2014 All Rights Reserved */ define("TOKEN", "weixin"); $wechatObj = new wechatCallbackapiTest(); if (!isset($_GET['echostr'])) { $wechatObj->responseMsg(); }else{ $wechatObj->valid(); } class wechatCallbackapiTest { //验证签名 public function valid() { $echoStr = $_GET["echostr"]; $signature = $_GET["signature"]; $timestamp = $_GET["timestamp"]; $nonce = $_GET["nonce"]; $token = TOKEN; $tmpArr = array($token, $timestamp, $nonce); sort($tmpArr); $tmpStr = implode($tmpArr); $tmpStr = sha1($tmpStr); if($tmpStr == $signature){ echo $echoStr; exit; } } //响应消息 public function responseMsg() { $postStr = $GLOBALS["HTTP_RAW_POST_DATA"]; if (!empty($postStr)){ $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA); $RX_TYPE = trim($postObj->MsgType);
//消息类型分离 switch ($RX_TYPE) { case "event": $result = $this->receiveEvent($postObj); break; case "text": $result = $this->receiveText($postObj); break; } echo $result; }else { echo ""; exit; } } //接收事件消息 private function receiveEvent($object) { $content = ""; switch ($object->Event) { case "subscribe": $content = "欢迎关注方倍工作室n回复 2048 开始游戏"; break; } if(is_array($content)){ if (isset($content[0])){ $result = $this->transmitNews($object, $content); }else if (isset($content['MusicUrl'])){ $result = $this->transmitMusic($object, $content); } }else{ $result = $this->transmitText($object, $content); } return $result; } //接收文本消息 private function receiveText($object) { $keyword = trim($object->Content);
if (strstr($keyword, "2048")){ $content = array(); $content[] = array("Title"=>"2048 Game", "Description"=>"The game rules are very simple. Each time you can choose one of the directions to slide up, down, left, or right. Each time you slide, all In addition to the number squares moving closer to each other in the sliding direction, the system will also randomly appear a number square in the blank space. When the squares with the same number come closer and collide, the number squares given by the system are either 2 or 4. Players have to. Find a way to make up the number square "2048" in this small 16-frame range. "Url" =>"http://gabrielecirulli.github.io/2048/"); }else{ $content = date("Y-m-d H:i:s",time())."nTechnical support Fangbei Studio"; }
if(is_array($content)){ if (isset($content[0]['PicUrl'])){ $result = $this->transmitNews($object, $content); }else if (isset($content['MusicUrl'])){ $result = $this->transmitMusic($object, $content); } }else{ $result = $this->transmitText($object, $content); } }
//Reply to text message private function transmitText($object, $content) { $xmlTpl = " "; $result = sprintf($xmlTpl, $object->FromUserName, $object->ToUserName, time(), $content); return $result; }
//Reply to graphic message private function transmitNews($object, $newsArray) { if(!is_array($newsArray)){ return; } $itemTpl = " "; $item_str = ""; foreach ($newsArray as $item){ $item_str .= sprintf($itemTpl, $item['Title'], $item['Description'], $item['PicUrl'], $item['Url']); } $xmlTpl = " $item_str "; $result = sprintf($xmlTpl, $object->FromUserName, $object->ToUserName, time(), count($newsArray)); return $result; } } ?> |

微信文件的过期时间需要根据情况来判断:1、如果发送的文件没有打开过,则在72小时以后微信系统会自动清理掉,即过了三天文件就会过期;2、如果已经查看了微信文件,但是并没有下载(当然已经下载的文件也是一样的),那么文件是可以保留180天的,在这180天以内随时都可以去下载。

区别:1、拉黑后对话框从主页消失,但是聊天记录还在;删除后聊天记录全部消失不见了。2、拉黑后还能发给他,但是收不到他的消息;删除后不能发信息了。3、拉黑后双方都不可见彼此的朋友圈;删除对方以后,你看不到对方的朋友圈了,对方是否能看到你的,取决于设置(允许陌生人查看十张照片)与否,如果设置则可以看到朋友圈。

支持微信付款的购物平台有:1、京东,是中国的综合网络零售商;2、唯品会,是一家在线销售品牌折扣商品的互联网公司;3、拼多多,是社交新电商领导者,更懂消费者的购物平台;4、京喜,是京东旗下生活消费商城;5、蘑菇街,一个电子商务网站;6、聚美优品,是一家以销售化妆品为主的时尚购物网站;7、微店,是一个云推广电子商务平台;8、考拉海购,是一个跨境海淘业务为主的会员电商平台。

微信查看ip地址的方法:1、登录电脑版微信,右键点击屏幕下方的任务栏,点击“任务管理器”;2、弹出任务管理器时,点击左下角的“详细信息”;3、任务管理器进入“性能”选项,点击“打开资源监视器”;4、选择“网络”,勾选微信进程“Wechat.exe”;5、点击下面的“TCP连接”即可监视微信网络IP相关情况,发送消息得到回复就会显示他人的IP地址。

可以。未经过实名认证的微信号,可以绑定他人的银行卡,但在绑定过程中需要提供银行卡的开户人姓名、开户行地址、开户时预留的联系方式及银行卡支付密码;已通过实名认证的微信号,无法绑定他人银行卡,只能添加使用自己身份证办理的银行卡。

不是,一个身份证能绑定5个微信。按照微信当前规定,一个身份证可以实名认证5个微信号;如果已经实名认证了5个微信账号,但是还想要继续实名,就要把已经实名认证的一些不用的微信号清除以后,才可以再实名认证新的微信号。

闲鱼是不支持微信支付的,仅支持使用支付宝进行付款;闲鱼是阿里巴巴旗下闲置交易平台App客户端,会员只要使用淘宝或支付宝账户登录,无需经过复杂的开店流程,即可达成包括一键转卖个人淘宝账号中“已买到宝贝”、自主手机拍照上传二手闲置物品、以及在线交易等诸多功能。

电脑微信打字打一个少一个是因为开启了改写状态,其解决办法:1、打开电脑微信;2、在微信聊天窗口输入对话文字内容;3、找到并按下键盘上的Insert键即可正常输入文字内容。


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Dreamweaver Mac version
Visual web development tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Zend Studio 13.0.1
Powerful PHP integrated development environment

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 English version
Recommended: Win version, supports code prompts!
