Source for you
Thanks for patience and your time
http://www.filefactory.com/file/c27324e/n/Pileczki.zip [import]uid: 117910 topic_id: 21266 reply_id: 86437[/import]
Hey there,
Running this and uncommenting the line to move the platforms (schodek) actually throws up some director errors; it also appears the last scene may not be getting cleaned.
Also the scene not being cleaned wouldn’t likely affect what’s happening here it does seem that the errors when the scene loads might be.
Have you used director prior to this project? [import]uid: 52491 topic_id: 21266 reply_id: 86442[/import]
i use only notepad [import]uid: 117910 topic_id: 21266 reply_id: 86469[/import]
Notepad is an editor, Director is a third party class for managing scenes.
In your project you are using director - but you have some errors being thrown up related to it in the level 1 scene. These errors could be affecting other things.
Does that make sense? [import]uid: 52491 topic_id: 21266 reply_id: 86552[/import]
I update director class to 1.4v and removed error but object don’t move my game file
[lua]-----------------------------------------------------------------------------------------
– main.lua
– Your code here
– inicjalizacja fizyki
module(…, package.seeall)
local localGroup
function new()
localGroup = display.newGroup()
local physics = require(“physics”)
physics.start()
physics.setGravity(0, 9.8)
–usuni?cie paska statusu
display.setStatusBar(display.HiddenStatusBar)
–poziom
local kLevelRows = 9
local kLevelCols = 9
schodek = {}
schodek[1] = {}
schodek[2] = {}
schodek[3] = {}
schodek[4] = {}
schodek[5] = {}
schodek[6] = {}
schodek[7] = {}
schodek[8] = {}
schodek[9] = {}
tab = {}
tab[1] = {0,0,0,1,0,0,0,0,0}
tab[2] = {0,0,0,0,0,0,0,0,0}
tab[3] = {0,0,0,0,0,0,0,0,0}
tab[4] = {0,0,0,0,0,0,0,0,0}
tab[5] = {0,0,0,0,0,0,0,0,0}
tab[6] = {0,1,0,0,0,0,0,0,0}
tab[7] = {0,0,0,0,0,0,0,0,0}
tab[8] = {0,0,0,0,0,0,0,0,0}
tab[9] = {0,0,0,0,0,0,0,0,0}
–obramowanie ekranu
–local leftWall = display.newRect(0, 0, 1, display.contentHeight)
–local rightWall = display.newRect(display.contentWidth, 0, 1, display.contentHeight)
local ceiling = display.newRect(0, 0, display.contentWidth, 1)
localGroup:insert(ceiling)
–dodanie boy dla obramowania
–physics.addBody(leftWall, “static”, {bounce = 0.1})
–physics.addBody(rightWall, “static”, {bounce = 0.1})
physics.addBody(ceiling, “static”, {bounce = 0.1})
–tlo
local tlo = display.newImage(“tlo.png”)
local tlo2 = display.newImage(“tlo.png”)
localGroup:insert(tlo)
localGroup:insert(tlo2)
tlo:setReferencePoint( display.CenterLeftReferencePoint )
tlo2:setReferencePoint( display.CenterLeftReferencePoint )
–pilka
local pilka = display.newImage(“pilka.png”)
localGroup:insert(pilka)
pilka.x = 100
pilka.y = 150
physics.addBody(pilka, {bounce = 0.2, radius = 17})
–rysowanie poziomu
local function poziom()
for i = 1, kLevelCols,1 do
for j = 1, kLevelRows,1 do
if tab[i][j] == 1 then
schodek[i][j] = display.newImage(“schodek.png”)
physics.addBody(schodek[i][j], “static”, {bounce = 0.3})
localGroup:insert(schodek[i][j])
schodek[i][j].y = (_W/12) * i
schodek[i][j].x = 75 * j
end
end
end
end
Runtime:addEventListener( “enterFrame”, poziom )
local function movePilka(event)
local pilka = event.target
pilka:applyLinearImpulse(0, -0.2, pilka.x, pilka.y)
end
pilka:addEventListener(“touch”, movePilka)
–ruch elementów
tlo.x = 0
tlo2.x = 959
local function przesuwaj(event)
–poziomy trudno?ci
poziom1 = 1
poziom2 = 5
poziom3 = 10
–animacja tla
for i = 1, kLevelCols do
for j = 1, kLevelRows do
if tab[i][j] == 1 then
schodek[i][j].x = schodek[i][j].x-10
end
end
end
tlo.x = tlo.x - 4
tlo2.x = tlo2.x - 4
if (tlo.x + tlo.contentWidth) < 0 then
tlo:translate( 959 * 2, 0)
end
if (tlo2.x + tlo2.contentWidth) < 0 then
tlo2:translate( 959 * 2, 0)
end
end
Runtime:addEventListener(“enterFrame”,przesuwaj)
local function removeOffscreenItems()
for i = 1, kLevelCols do
for j = 1, kLevelRows do
if tab[i][j] == 1 then
if schodek[i][j].x > display.contentWidth + 100 then
schodek[i][j]:removeSelf()
end
end
end
end
end
Runtime:addEventListener(“enterFrame”,removeOffscreenItems)
return localGroup
end[/lua] [import]uid: 117910 topic_id: 21266 reply_id: 87646[/import]
even without director class this platform dont move [import]uid: 117910 topic_id: 21266 reply_id: 87674[/import]