Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local halfW = display.contentWidth * 0.5
- local halfH = display.contentHeight * 0.5
- local vertices = { 0,-110, 27,-35, 105,-35, 43,16, 65,90, 0,45, -65,90, -43,15, -105,-35, -27,-35, }
- local o = display.newPolygon( halfW, halfH, vertices )
- o.fill = { type="image", filename="mountains.png" }
- o.strokeWidth = 10
- o:setStrokeColor( 1, 0, 0 )
- o.rotation = math.random(360)
- local dr = math.random( 1, 4 )
- o.dr = dr
- if ( math.random() < 0.5 ) then
- o.dr = -dr
- end
- table.insert( o, o )
- --table.insert( stars, myStar )
- function o:enterFrame( event )
- for i,v in ipairs( self ) do
- v.rotation = v.rotation+ v.dr
- end
- end
- Runtime:addEventListener( "enterFrame", o )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement