This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --CountDown App 2 | |
| W=display.contentWidth/2 | |
| H=display.contentHeight/2 | |
| local time = 3 -- count down from 3 | |
| local gogogo = display.newText("Go go go!", 0, 0, "James Fajardo", 100) | |
| gogogo.alpha=0 --is not visible | |
| gogogo.x=W | |
| gogogo.y=H | |
| local timeSound=audio.loadSound("button.wav") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local storyboard = require ("storyboard") --import storyboard | |
| local scene = storyboard.newScene() --create a new scene | |
| function scene:createScene(event) --create your objects here | |
| local group = self.view --In scene's view, we'll add(insert) our display objects | |
| time = 3 -- count down from 3 | |
| --Text will be displayed when time is up! | |
| gogogo = display.newText("Go go go!", 0, 0, "James Fajardo", 100) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local storyboard = require("storyboard") --import storyboard | |
| storyboard.purgeOnSceneChange=true --clean scene before moving anothe scene | |
| --GLOBALS-- | |
| W=display.contentWidth | |
| H=display.contentHeight | |
| ----------------------------- | |
| --Change scene-- | |
| storyboard.gotoScene("scene1") --go to first scene |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local director = require("director") --import director | |
| --GLOBALS-- | |
| W = display.contentWidth | |
| H = display.contentHeight | |
| --Change Scene-- | |
| director: changeScene("scene1") -- go to first scene |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module(..., package.seeall) | |
| local director = require("director") | |
| function new() --all objects and functions should be inside this function | |
| local group = display.newGroup() --create a group object to keep display objects | |
| time = 3 -- count down from 3 | |
| --Text will be displayed when time is up! | |
| gogogo = display.newText("Go go go!", 0, 0, "James Fajardo", 100) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- create object | |
| local myObject = display.newRect( 0, 0, 100, 100 ) | |
| myObject:setFillColor( 255 ) | |
| -- touch listener function | |
| function myObject:touch( event ) | |
| if event.phase == "began" then | |
| self.markX = self.x -- store x location of object | |
| self.markY = self.y -- store y location of object | |
| elseif event.phase == "moved" then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- create objects | |
| local rect1 = display.newRect( 0, 0, 100, 100 ) | |
| local rect2 = display.newRect(300,300, 50,50) | |
| -- touch listener function | |
| local function move(self, event ) | |
| if event.phase == "began" then | |
| --set focus on touched object so it won't interfere with other display objects. | |
| display.getCurrentStage():setFocus( self, event.id ) | |
| self.isFocus = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # | |
| # Copyright 2007 Google Inc. | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # | |
| # Copyright 2007 Google Inc. | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import webapp2,cgi | |
| form='''<form method="post"> | |
| <textarea name="text"> | |
| %(text)s | |
| </textarea> | |
| <input type="submit"> | |
| </form> | |
| ''' |