I can't get may game to play

I’m sure most of you are going to be like omg. But I’m new and teaching my self by reading the lua user wiki and watching tutorials by Rafael Hernandez and others about two weeks now. But I can’t get my code to play in my T mobile Samsung galaxy tab, It installs and boots up and I can see the rectwalls that’s in the game but nothing happens. It runs in the sdk simulator. is there something that I’m leaving out that actives the code or something. here is my code

this is my first attempt to making a app and my code is base off of Rafael Hernandez seeing that I’m doing most of my learning from him I hope this isn’t considered plagiarizing.

[code]
_H = display.contentHeight;
_W = display.contentWidth;
mR = math.random;
numberOfBule = 45;
numberOfRed = 15;
countToStart = 3;
ready = false;
go = true;
local physics = require(“physics”);
physics.start();

–sounds and soundtrack
local pop = audio.loadSound(“assets/media/pop01.wav”)
local fart = audio.loadSound(“assets/media/fart.wav”)

–[[local startG = display.newText(countTOStart, 0, 0, native.systemFont, 16*2)
startG.xScale = .5;
startG.yScale = .5;
startG:setReferencePoint(display.centerReferencePoint);
startG.x = _H/2
startG.y = _W/2
–]]

function start ()
if(countTOStart.txt == 0) then
ready = go
end
countTOStart = countTOStart - 1
startG.text = countTOStart

end

function removeDot(obj)
obj:removeSelf();
end

local function dots()
local dot = display.newImage( “assets/Graphics/blueDot2.png”,45, 45)
dot:setReferencePoint(display.centerReferencePoint);
dot.x = mR(60, _W - 50);
dot.y = mR(70, _H - 50);
physics.addBody( dot, { density = -1.0, friction = 4.3, bounce = 0.2, radius = 25 } );

function dot:touch(event)
if (event.phase == “ended”) then
audio.play(pop);
removeDot(self)
end

end
dot:addEventListener(“touch”, dot)
end
tmr = timer.performWithDelay(1000,dots, numberOfBule);
local function dots2()
local dot2 = display.newImage( “Assets/Graphics/redDot.png”,25, 25)
dot2:setReferencePoint(display.centerReferencePoint);
dot2.x = mR(60, _W - 50);
dot2.y = mR(70, _H - 50);
physics.addBody( dot2, { density = 1.0, friction = 0.3, bounce = 1.2, radius = 23 } );

dot2:addEventListener(“touch”, fart_n)
end

function fart_n(event)
if(event.phase == “ended”) then
audio.play(fart)
end
end

tmr = timer.performWithDelay(2000,dots2, numberOfRed);

local floor = display.newRect(0,0, _W,20);
floor:setReferencePoint(display.centerReferencePoint);
floor.x = _W/2
floor.y = 500
physics.addBody(floor, “static”, {friction = 0.3, bounce = 0.2} );

local roof = display.newRect(0,0, _W,20);
roof:setReferencePoint(display.centerReferencePoint);
roof.x = _W/2
roof.y = -38
local left_wall = display.newRect(0,0,1, _H);
left_wall:setReferencePoint(display.centerReferencePoint);
left_wall.x = 0-left_wall.width/2
left_wall.y = _H/2

local right_wall = display.newRect(0,0,5, _H);
right_wall:setReferencePoint(display.centerReferencePoint);
right_wall.x = _W+right_wall.width/2
right_wall.y = _H/2

physics.addBody(roof, “static”, {friction = 0.3, bounce = 0.2} );

physics.addBody(left_wall, “static”, {friction = 0.3, bounce = 0.2} );

physics.addBody(right_wall, “static”, {friction = 0.3, bounce = 0.2} );

[import]uid: 121743 topic_id: 23571 reply_id: 323571[/import]

I see these 2 lines:

local dot = display.newImage( “assets/Graphics/blueDot2.png”,45, 45)

local dot2 = display.newImage( “Assets/Graphics/redDot.png”,25, 25)

You’re using both capital A and lower case a for the name of the directory. Go through your code and make sure the names of all you directories and files match the actual names.

The simulator may overlook this and treat “Assets” and “assets” the same, but the device is case sensitive and everything has to match 100%.

[import]uid: 67839 topic_id: 23571 reply_id: 94534[/import]

Thank elbowroomapps that was the problem then second I that I rebuild the game and put it on my device and it worked flawless thank you [import]uid: 121743 topic_id: 23571 reply_id: 94662[/import]

Another question if i keep adding function or newImage with out grouping them will the master group get full or some thing because im trying to add more images to the screen to do other things but it get keeps giving me and errors and it dosnt matter what kind of image or where i put it [import]uid: 121743 topic_id: 23571 reply_id: 94886[/import]

What error message are you getting? Do you get the error on bot the simulator and the device? [import]uid: 67839 topic_id: 23571 reply_id: 94944[/import]

mpt to index global ‘diplay’ (a nil value)
stack traceback:
[C]: ?
…gs\kings\my documents\corona projects\timer\main.lua:109: in main chu
nk

Copyright © 2009-2011 A n s c a , I n c .
Version: 2.0.0
Build: 2011.704
Runtime error
…gs\kings\my documents\corona projects\timer\main.lua:78: attempt to i
ndex global ‘diplay’ (a nil value)
stack traceback:
[C]: ?
…gs\kings\my documents\corona projects\timer\main.lua:78: in main chun
k
Runtime error: …gs\kings\my documents\corona projects\timer\main.lua:78: attem
pt to index global ‘diplay’ (a nil value)
stack traceback:
[C]: ?
…gs\kings\my documents\corona projects\timer\main.lua:78: in main chun
k

Copyright © 2009-2011 A n s c a , I n c .
Version: 2.0.0
Build: 2011.704
Runtime error
…gs\kings\my documents\corona projects\timer\main.lua:85: attempt to i
ndex global ‘diplay’ (a nil value)
stack traceback:
[C]: ?
…gs\kings\my documents\corona projects\timer\main.lua:85: in main chun
k
Runtime error: …gs\kings\my documents\corona projects\timer\main.lua:85: attem
pt to index global ‘diplay’ (a nil value)
stack traceback:
[C]: ?
…gs\kings\my documents\corona projects\timer\main.lua:85: in main chun
k

Copyright © 2009-2011 A n s c a , I n c .
Version: 2.0.0
Build: 2011.704
Runtime error
…gs\kings\my documents\corona projects\timer\main.lua:103: attempt to
index global ‘diplay’ (a nil value)
stack traceback:
[C]: ?
…gs\kings\my documents\corona projects\timer\main.lua:103: in main chu
nk
Runtime error: …gs\kings\my documents\corona projects\timer\main.lua:103: atte
mpt to index global ‘diplay’ (a nil value)
stack traceback:
[C]: ?
…gs\kings\my documents\corona projects\timer\main.lua:103: in main chu
nk

Copyright © 2009-2011 A n s c a , I n c .
Version: 2.0.0
Build: 2011.704
Runtime error
…gs\kings\my documents\corona projects\timer\main.lua:110: attempt to
index global ‘diplay’ (a nil value)
stack traceback:
[C]: ?
…gs\kings\my documents\corona projects\timer\main.lua:110: in main chu
nk
Runtime error: …gs\kings\my documents\corona projects\timer\main.lua:110: atte
mpt to index global ‘diplay’ (a nil value)
stack traceback:
[C]: ?
…gs\kings\my documents\corona projects\timer\main.lua:110: in main chu
nk

Copyright © 2009-2011 A n s c a , I n c .
Version: 2.0.0
Build: 2011.704
Runtime error
…gs\kings\my documents\corona projects\timer\main.lua:110: attempt to
index global ‘diplay’ (a nil value)
stack traceback:
[C]: ?
…gs\kings\my documents\corona projects\timer\main.lua:110: in main chu
nk
Runtime error: …gs\kings\my documents\corona projects\timer\main.lua:110: atte
mpt to index global ‘diplay’ (a nil value)
stack traceback:
[C]: ?
…gs\kings\my documents\corona projects\timer\main.lua:110: in main chu
nk

Copyright © 2009-2011 A n s c a , I n c .
Version: 2.0.0
Build: 2011.704
Runtime error
…gs\kings\my documents\corona projects\timer\main.lua:74: attempt to i
ndex global ‘diplay’ (a nil value)
stack traceback:
[C]: ?
…gs\kings\my documents\corona projects\timer\main.lua:74: in main chun
k
Runtime error: …gs\kings\my documents\corona projects\timer\main.lua:74: attem
pt to index global ‘diplay’ (a nil value)
stack traceback:
[C]: ?
…gs\kings\my documents\corona projects\timer\main.lua:74: in main chun
k

Copyright © 2009-2011 A n s c a , I n c .
Version: 2.0.0
Build: 2011.704
Runtime error
…gs\kings\my documents\corona projects\timer\main.lua:74: attempt to i
ndex global ‘diplay’ (a nil value)
stack traceback:
[C]: ?
…gs\kings\my documents\corona projects\timer\main.lua:74: in main chun
k
Runtime error: …gs\kings\my documents\corona projects\timer\main.lua:74: attem
pt to index global ‘diplay’ (a nil value)
stack traceback:
[C]: ?
…gs\kings\my documents\corona projects\timer\main.lua:74: in main chun
k

Copyright © 2009-2011 A n s c a , I n c .
Version: 2.0.0
Build: 2011.704
Runtime error
…gs\kings\my documents\corona projects\timer\main.lua:74: attempt to i
ndex global ‘diplay’ (a nil value)
stack traceback:
[C]: ?
…gs\kings\my documents\corona projects\timer\main.lua:74: in main chun
k
Runtime error: …gs\kings\my documents\corona projects\timer\main.lua:74: attem
pt to index global ‘diplay’ (a nil value)
stack traceback:
[C]: ?
…gs\kings\my documents\corona projects\timer\main.lua:74: in main chun
k

Copyright © 2009-2011 A n s c a , I n c .
Version: 2.0.0
Build: 2011.704

Copyright © 2009-2011 A n s c a , I n c .
Version: 2.0.0
Build: 2011.704

Copyright © 2009-2011 A n s c a , I n c .
Version: 2.0.0
Build: 2011.704

Copyright © 2009-2011 A n s c a , I n c .
Version: 2.0.0
Build: 2011.704

Copyright © 2009-2011 A n s c a , I n c .
Version: 2.0.0
Build: 2011.704

Copyright © 2009-2011 A n s c a , I n c .
Version: 2.0.0
Build: 2011.704

Copyright © 2009-2011 A n s c a , I n c .
Version: 2.0.0
Build: 2011.704

Copyright © 2009-2011 A n s c a , I n c .
Version: 2.0.0
Build: 2011.704

Copyright © 2009-2011 A n s c a , I n c .
Version: 2.0.0
Build: 2011.704

Copyright © 2009-2011 A n s c a , I n c .
Version: 2.0.0
Build: 2011.704

Copyright © 2009-2011 A n s c a , I n c .
Version: 2.0.0
Build: 2011.704

Copyright © 2009-2011 A n s c a , I n c .
Version: 2.0.0
Build: 2011.704

Copyright © 2009-2011 A n s c a , I n c .
Version: 2.0.0
Build: 2011.704

Copyright © 2009-2011 A n s c a , I n c .
Version: 2.0.0
Build: 2011.704

Copyright © 2009-2011 A n s c a , I n c .
Version: 2.0.0
Build: 2011.704
Runtime error
…gs\kings\my documents\corona projects\timer\main.lua:25: attempt to i
ndex global ‘diplay’ (a nil value)
stack traceback:
[C]: ?
…gs\kings\my documents\corona projects\timer\main.lua:25: in main chun
k
Runtime error: …gs\kings\my documents\corona projects\timer\main.lua:25: attem
pt to index global ‘diplay’ (a nil value)
stack traceback:
[C]: ?
…gs\kings\my documents\corona projects\timer\main.lua:25: in main chun
k

Copyright © 2009-2011 A n s c a , I n c .
Version: 2.0.0
Build: 2011.704
Runtime error
…gs\kings\my documents\corona projects\timer\main.lua:24: attempt to i
ndex global ‘diplay’ (a nil value)
stack traceback:
[C]: ?
…gs\kings\my documents\corona projects\timer\main.lua:24: in main chun
k
Runtime error: …gs\kings\my documents\corona projects\timer\main.lua:24: attem
pt to index global ‘diplay’ (a nil value)
stack traceback:
[C]: ?
…gs\kings\my documents\corona projects\timer\main.lua:24: in main chun
k

Copyright © 2009-2011 A n s c a , I n c .
Version: 2.0.0
Build: 2011.704
Runtime error
…gs\kings\my documents\corona projects\timer\main.lua:24: attempt to i
ndex global ‘diplay’ (a nil value)
stack traceback:
[C]: ?
…gs\kings\my documents\corona projects\timer\main.lua:24: in main chun
k
Runtime error: …gs\kings\my documents\corona projects\timer\main.lua:24: attem
pt to index global ‘diplay’ (a nil value)
stack traceback:
[C]: ?
…gs\kings\my documents\corona projects\timer\main.lua:24: in main chun
k

Copyright © 2009-2011 A n s c a , I n c .
Version: 2.0.0
Build: 2011.704
Runtime error
…gs\kings\my documents\corona projects\timer\main.lua:24: attempt to i
ndex global ‘diplay’ (a nil value)
stack traceback:
[C]: ?
…gs\kings\my documents\corona projects\timer\main.lua:24: in main chun
k
Runtime error: …gs\kings\my documents\corona projects\timer\main.lua:24: attem
pt to index global ‘diplay’ (a nil value)
stack traceback:
[C]: ?
…gs\kings\my documents\corona projects\timer\main.lua:24: in main chun
k

Copyright © 2009-2011 A n s c a , I n c .
Version: 2.0.0
Build: 2011.704
Runtime error
…gs\kings\my documents\corona projects\timer\main.lua:25: attempt to i
ndex global ‘diplay’ (a nil value)
stack traceback:
[C]: ?
…gs\kings\my documents\corona projects\timer\main.lua:25: in main chun
k
Runtime error: …gs\kings\my documents\corona projects\timer\main.lua:25: attem
pt to index global ‘diplay’ (a nil value)
stack traceback:
[C]: ?
…gs\kings\my documents\corona projects\timer\main.lua:25: in main chun
k

Copyright © 2009-2011 A n s c a , I n c .
Version: 2.0.0
Build: 2011.704
Runtime error
…gs\kings\my documents\corona projects\timer\main.lua:25: attempt to i
ndex global ‘diplay’ (a nil value)
stack traceback:
[C]: ?
…gs\kings\my documents\corona projects\timer\main.lua:25: in main chun
k
Runtime error: …gs\kings\my documents\corona projects\timer\main.lua:25: attem
pt to index global ‘diplay’ (a nil value)
stack traceback:
[C]: ?
…gs\kings\my documents\corona projects\timer\main.lua:25: in main chun
k

so I get back home and i start up corona i run the app and no errors now that doesn’t make sense it’s the same code but i still have the same problem i cant see my image that i would like to see display on the screen so what your looking at (at the top ) is me moving that one image around in different spots. it will run in some spots and in others it wont but it will never actually display on the screen
function purpleDot ()
local pdot = diplay.display.newImage( “assets/graphics/purpleDot.png”)
pdot:setReferencePoint(display.centerReferencePoint)
pdot.x = _W/2
pdot.y = _H/2

end
so I was thinking maybe i didnt make the image right in photoshop so I made it over several times still nothing then I toke a picture from Google and made it a back ground and it displayed fine
which i did like this
local bg = display.newImage(“assets/graphics/purpleDot.png”)
then I try doing the same thing to my purpleDot

local pdot = diplay.display.newImage( “assets/graphics/purpleDot.png”)

and it just gave a error
[import]uid: 121743 topic_id: 23571 reply_id: 95071[/import]

local pdot = diplay.display.newImage( “assets/graphics/purpleDot.png”)

You have the words diplay and display in that line. Delete the diplay.

[import]uid: 67839 topic_id: 23571 reply_id: 95077[/import]

Oh wow I can believe these little things are being overlooked. are there any plugins that can help me debug and catch simple and hard error’s, or a better editor right now I’m using notepad++ on windows.
So I toke out diplay but it didn’t show up when I typed it like this.

local function purple_dot ()
local pdot = display.newImage( “assets/graphics/purpleDot.png”)
pdot:setReferencePoint(display.centerReferencePoint)
pdot.x = _W/2
pdot.y = 500
end

but it did show up when I did it like this
local pdot = display.newImage( “assets/graphics/purpleDot.png”)
pdot:setReferencePoint(display.centerReferencePoint)
pdot.x = _W/2
pdot.y = 500

or this
local pdot = display.newImage( “assets/graphics/purpleDot.png”)

but I need It in a local function so I can put some logic’s and functions in it to make it click able and what not

like this

gravity = physics.setGravity( .0, .10)

gravity = false
local function purple_dot ()
local pdot = display.newImage( “assets/graphics/purpleDot.png”)
pdot:setReferencePoint(display.centerReferencePoint)
pdot.x = _W/2
pdot.y = 500

pdot:addEventListener(“touch”, slow_mo)

function slow_mo (event)
if (event.phase == “ended”) then
gravity = true
else
gravity = false
end
end
end

I know the functions don’t work right I’m just trying to figure out how to make a switch or do while so when slow_mo is touch it only works for 3 or 4 seconds and then every thing goes back to normal. but that’s the code I’m trying to make show up on the screen [import]uid: 121743 topic_id: 23571 reply_id: 95176[/import]

There are lots of different editors you could use. It’s probably best to try them out and see which one is best for you.

I can’t tell what is wrong with the code you posted. I would suggest finding one of the CoronaSDK samples that is close or similar to what you’re trying to do. Then read through the code and see if you can follow what they are doing. From there, start modifying it to be what you want. [import]uid: 67839 topic_id: 23571 reply_id: 95340[/import]

I think you are mixing your variables:
[lua]function start ()
if(countTOStart.txt == 0) then
ready = go
end
countTOStart = countTOStart - 1
startG.text = countTOStart[/lua]

You have countTOStart.txt and countTOStart
Your first line should be :

[lua] if(countTOStart == 0) then[/lua] [import]uid: 10389 topic_id: 23571 reply_id: 95342[/import]

Your function:

[lua]function start ()[/lua]

never gets called anywhere in the code! [import]uid: 10389 topic_id: 23571 reply_id: 95343[/import]

which editor do you use and I’ll look around to find something like my code but it’s not that the logic isnt work im just wondering why the image isn’t showing when i put it in a function like i did with the other images but thank you for you help before or i would of been stuck on that one little problem [import]uid: 121743 topic_id: 23571 reply_id: 95494[/import]

function start ()
if(countTOStart.txt == 0) then
ready = go
end
countTOStart = countTOStart - 1
startG.text = countTOStart
Oh that I toke that out that was a tutorial I was trying to follow. I’ll go back to that tutorial [import]uid: 121743 topic_id: 23571 reply_id: 95495[/import]

ok ok I found out what i was doing wrong I guess because I put a timer.performWithDelay to all my images to respond with the mR = math.random;

it need to do that with every image i put up i’ll call this one a learning experience out of many yo come [import]uid: 121743 topic_id: 23571 reply_id: 95533[/import]

this is me trying to recreate a on off switch function from Nexus Game Studio this is their code

–SIMPLE LUA SWITCH FUNCTION by Nexus Game Studio (09/30/11)

W = display.contentWidth
H = display.contentHeight

–Displays a basic red rectangle that is placed in the center of the screen
–This is a button
button = display.newRect (50,50,50,50)
button:setFillColor(255,0,0)
button.x = W / 2
button.y = H / 2

–Displays a basic yellow circle that is placed above the button
–This is a light
light = display.newCircle (50,50,50)
light:setFillColor(255,255,0)
light.x = W / 2
light.y = H / 4
light.isVisible = false --Turn visible to false if you want the light to be off initially, if you want it to be on initially, delete this line

local power = true

–Tap function that detects when the user has touched the red switch. You can replace “.isVisible” with any function of your own choosing.
function button:tap(event)
if (power == false) then
light.isVisible = false
power = true
else
light.isVisible = true
power = false
end
end

–Event listener that calls the button function when the red box is touched.
button:addEventListener( ‘tap’, button)

I hope this helps anyone out who is looking for a simple solution to creating a switch function in Lua. This code is built for development on iOS, specifically Corona SDK (hence the “tap” functions) so if used for development on other platforms, feel free to modify the code to your preferred input. This is my attempt at it, if anyone else has ideas for a simpler or more efficient version, feel free to share.

here is my code

unction gforce ()
gravity = physics.setGravity( .0, .10)
gravity = false
end
on = true

local function dot3 ()

local pdot = display.newImage( “assets/graphics/purpleDot.png”)
pdot:setReferencePoint(display.centerReferencePoint)
pdot.x = _W/2
pdot.y = 500
physics.addBody( pdot,“static”, { density = -0.0, friction = 0.3, bounce = 0.0, radius = 32 } );

pdot:addEventListener(“touch”, slow_pop)
pdot:addEventListener(“touch”, pdot )

function pdot:touch(event)
if (on == false) then
gforce = false
on = true
else
gforce = true
on = false

end
end
end
timer.performWithDelay(3000, pdot, 1)

function slow_pop (event)
if(event.phase == “ended”) then
audio.play(pop)
end
end

tmr = timer.performWithDelay(0,dot3, 1);

what am I going wrong here
[import]uid: 121743 topic_id: 23571 reply_id: 95629[/import]