上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 43 下一页
摘要: 1.luagame = {}function game.play() print("那么,开始吧");endreturn game;2.luarequire "1"function game.quit() print("你走吧,我保证你不会出事的,呵,呵呵");endmain.luare... 阅读全文
posted @ 2015-02-28 12:50 yufenghou 阅读(168) 评论(0) 推荐(0)
摘要: require "Cocos2d"require "Cocos2dConstants"local cclog = function(...) print(string.format(...))endlocal TestScene = class("TestScene",function() ... 阅读全文
posted @ 2015-02-27 22:48 yufenghou 阅读(325) 评论(0) 推荐(0)
摘要: require "Cocos2d"require "Cocos2dConstants"local TestScene = class("TestScene",function() return cc.Scene:create()end)function TestScene.create() ... 阅读全文
posted @ 2015-02-27 22:27 yufenghou 阅读(230) 评论(0) 推荐(0)
摘要: require "Cocos2d"require "Cocos2dConstants"local TestScene = class("TestScene",function() return cc.Scene:create()end)function TestScene.create() ... 阅读全文
posted @ 2015-02-27 02:09 yufenghou 阅读(366) 评论(0) 推荐(0)
摘要: Account={balance=0}function Account.count(v) -- body print("value is:"..v)enda=Accounta.count(100)Account={balance=0}function Account.count(self... 阅读全文
posted @ 2015-02-27 01:46 yufenghou 阅读(88) 评论(0) 推荐(0)
摘要: aa.luacomplex={}function complex.showName() print ("woshi dongshen ")endreturn complex1.lualocal mymodule=require("aa")mymodule.showName(); 阅读全文
posted @ 2015-02-27 01:22 yufenghou 阅读(140) 评论(0) 推荐(0)
摘要: aa.luafunction showName( var ) print ("woshi dongshen "..var)end1.luarequire("aa")showName("ok") 阅读全文
posted @ 2015-02-27 01:01 yufenghou 阅读(131) 评论(0) 推荐(0)
摘要: --io文件当中有一个叫做open的函数--r 读, a 追加,w写,b二进制local f=assert(io.open("1.txt","r"))local string=f:read("*all")f:close();print(string)--io文件当中有一个叫做open的函数--r 读... 阅读全文
posted @ 2015-02-26 23:26 yufenghou 阅读(216) 评论(0) 推荐(0)
摘要: mytable={ k="string", m="dongshen", 1,3,5}print(mytable[k]) --无法找到结果print(mytable["k"]) --可以找到结果print(mytable.k)--第一种遍历,只输出了数字索引的内容--但遇到有缝隙的时... 阅读全文
posted @ 2015-02-26 10:54 yufenghou 阅读(112) 评论(0) 推荐(0)
摘要: print "helloworld"--1 table 做配置文件--2 table 做数据集mytable ={}mytable2={1,2,3,4,5,"ok"}--index 从1开始for i=1 ,#mytable2 do print (mytable2[i])end 阅读全文
posted @ 2015-02-24 22:55 yufenghou 阅读(154) 评论(0) 推荐(0)
上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 43 下一页