Skip to content

Latest commit

 

History

History
33 lines (26 loc) · 581 Bytes

README.md

File metadata and controls

33 lines (26 loc) · 581 Bytes

Reol-Engine 设计思路

我们可以用以下方式来搭建我们的游戏

以下代码仅供提供思路和参考

// room1.js
class MainRoom {
   constructor (conf) {
     const { dialog } = conf
     this.name = 'MainRoom'   
     this.dialog = dialog  // dialog 为生成器
   }
   
   update () {
 
   }
 
   created () {
     return (
       <Screen>
         <DialogTable>
           <Dialog data={this.dialog.value} click={this.nextDialog()}></Dialog>
         </DialogTable>
       </Screen>)
   }
   
   nextDialog () {
     this.dialog.next()
   }
 }