"Cocos Creator Game Combat" check-in calendar implementation ideas (including regular calendar)

Online experience address

Cocos Creator | SignCalendar

Cocos Store 购买地址(如果没有显示,那就是还在审核):
https://store.cocos.com/app/detail/4975
 
微店购买地址:
https://weidian.com/item.html?itemID=6354270477

running result 

Attendance Calendar and Regular Calendar

development environment

  • Editor version: 3.7.3
  • Development language: TypeScript

Implementation ideas

This is the node information for signing in to the calendar:

1. Calendar is an empty node.

2. The Sprite1 and Sprite2 nodes are used to display the picture of the sign-in calendar.

3. Title Label is the title displayed on the calendar.

 4. Time Label is the active time, and the developer can set its content in the code.

5. There is a scroll view node ScrollView under the Sprite1 and Sprite2 nodes, because the event date may be longer and there will be more prizes, so ScrollVIew should be used.

6. The content node is a layout node, and we will dynamically add prize items to it in the code.

7. The Item prefab is actually a button node. After the user clicks on the Item, the program can judge whether it can be received (the same is true for the AddedUPItem prefab).

8 The Item prefab contains Label nodes and Sprite nodes. The Label node is used to display the number of days, and the Sprite node is used to display the prize image (the same applies to the AddedUPItem prefab). We can calculate the actual check-in date corresponding to the prize item based on the number of days and the start time of the event.

9. The Frame node is a red box, which is used to prompt the user to click on this Item. If the item's check-in date is the same as today's date, the Frame node will be displayed.

10. The Check node is a tick picture. If the user signs in, the Check node will be displayed on the corresponding prize item.

 11. Finally, there is the Notice Board node, which is used to remind the user of the current check-in result.

The implementation of the check-in calendar is not difficult, but it is more troublesome. As long as the code for date comparison is written, there will be no problem with the overall function.

Note: The time verification of this project is performed locally. In order to prevent users from tampering with the local time, we should verify the time in the server.

Guess you like

Origin blog.csdn.net/La_vie_est_belle/article/details/130944716