Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local composer = require( 'composer' )
- local physics = require( 'physics' )
- berry = require( 'pl.ldurniat.berry' )
- local tiled = require( "com.ponywolf.ponytiled" )
- local json = require( "json" )
- local scene = composer.newScene()
- function scene:create( event )
- local sceneGroup = self.view
- ---[[
- local physics = require( 'physics' )
- berry = require( 'pl.ldurniat.berry' )
- physics.start()
- local map = berry.loadMap( 'Map.json' )
- local visual = berry.createVisual( map )
- berry.buildPhysical( map )
- Ball = display.newCircle( display.contentCenterX, display.contentCenterY, 10)
- Ball.angularDamping = 1
- Ball.strokeWidth = 1
- Ball:setFillColor( 0.25, 0.5, 0.25 )
- Ball:setStrokeColor( 0, 3, 0 )
- physics.addBody(Ball, 'dynamic', { friction = 0.5, bounce = 0.2, radius = 10 } )
- visual:insert( Ball )
- sceneGroup:insert( visual )
- end
- function scene:show( event )
- local sceneGroup = self.view
- local phase = event.phase
- if phase == 'will' then
- elseif phase == 'did' then
- end
- end
- function scene:hide( event )
- local sceneGroup = self.view
- local phase = event.phase
- if event.phase == 'will' then
- elseif phase == 'did' then
- end
- end
- function scene:destroy( event )
- local sceneGroup = self.view
- end
- scene:addEventListener( 'create', scene )
- scene:addEventListener( 'show', scene )
- scene:addEventListener( 'hide', scene )
- scene:addEventListener( 'destroy', scene )
- return scene
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement