Hy my friends, i m new Here My name is Patric and i’m 24 years old.(sory for my bad english)
So i m now making second tutorial with ship and space, but with my graphics…
So problem is i see background but dont see the gameobjects like ship asteroids…
Maybe can anyone Help me with this issue
I write so, so you can watch where is the problem etc maybe (main.lua)
local physics = require( “physics” )
physics.start()
physics.setGravity( 0, 0 )
– SEED the random number generator – Potrzebne do kulek jakiś tam coś sie ogarnie
math.randomseed( os.time() )
– Configure image sheet
local sheetOptions =
{
frames =
{
{ – 1) asteroida 1
x = 0,
y = 0,
width = 102,
height = 85
},
{ – 2) asteroida 2
x = 0,
y = 85,
width = 90,
height = 83
},
{ – 3) asteroida 3
x = 0,
y = 168,
width = 100,
height = 97
},
{ – 4) AlienShip
x = 0,
y = 265,
width = 98,
height = 79
},
{ – 5) laser
x = 98,
y = 265,
width = 14,
height = 40
},
},
}
local objectSheet = graphics.newImageSheet( “gameObjects.png”, sheetOptions )
– Initializujemy Varianty
local lives = 5
local score = 0
local died = false
local asteroidsTable = {0}
local AlienShip
local gameLoopTimer
local livesText
local scoreText
– Tworzymy grupki
local backGroup = display.newGroup() – Pokazuje grupe obrazu w tle
local mainGroup = display.newGroup() – Pokazuje wszystko inne co powinno być – Main
local uiGroup = display.newGroup() – Pokazuje puknciory etc
– Obraz w tle cipo
local background = display.newImageRect( backGroup, “background.jpg”, 800,1400 )
background.x = display.contentCenterX
background.y = display.contentCenterY
AlienShip = display.newImageRect( mainGroup, objectSheet, 4, 98, 79 )
AlienShip.x = display.contentCenterX
AlienShip.y = display.contentHeight - 100
physics.addBody( AlienShip, { radius=30, isSensor=true } )
AlienShip.myName = “AlienShip”
– Display lives and Score
livesText =display.newText( uiGroup, "Zytka: " … lives, 60, 0, native.systemFont, 24 )
scoreText = display.newText( uiGroup, "Punkciory: " … score, 250, 0, native.systemFont, 24 )
– Hide the status bar
display.setStatusBar( display.HiddenStatusBar )
local function updateText()
livesText.text = "Zytka: " … lives
scoreText.text = "Punkciory: " … score
end