Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]

Unexpected symbol near ','
Started by millycombe Jan 04 2019 05:25 AM

2 replies to this topic
This topic has been archived. This means that you cannot reply to this topic.
[TOPIC: post.html]


[GLOBAL: userInfoPane.html]
  • Observer

  • 1 posts
  • Corona SDK

So I'm pretty new to programming and Lua in general and decided to try out the tutorial on making your first game on Corona, the 'BalloonTap' game. I got the source files and put the png's into the BalloonTap folder which show up as they should do. I can't even complete the first part of the tutorial though as I can't add the background. I get the error "unexpected symbol near ','" whenever I input the code it tells me to input. My current code:



local background = display.newImageRect( "background.png", 360, 570 )
background.x = display.contentCenterX
background.y = display.contentCenterY


This is exactly as it's written on the tutorial and I can't see why I'm getting this error. I downloaded SublimeText and am now using that instead of plain TextEdit but it still throws the error.


I then deleted everything from main.lua and closed and refreshed it, re-entered the code and relaunched the game and it comes up with no error, but a completely black screen. Nothing happens. I can't see any errors appearing on console.


What have I done wrong? Thank you!

[TOPIC: post.html]

XeduR @Spyric

[GLOBAL: userInfoPane.html]
XeduR @Spyric
  • Contributor

  • 762 posts
  • Corona SDK

The code that you've posted is 100% correct. If you received an error before, it wasn't due to those three lines of code.

If you downloaded the source files and everything, then I don't really know as to why you have a black screen. Some users have reported some such issues concerning their graphics drivers or something. I'd recommend that you try loading some of the sample projects and see if they work or if you are still getting a black screen. You can find the sample projects in the simulator within Help > Sample Projects. If you are still getting a black screen, you might want to update your drivers. If that doesn't help, then maybe someone else can help you.

[TOPIC: post.html]


[GLOBAL: userInfoPane.html]
  • Corona Geek

  • 7,585 posts
  • Corona SDK

did you paste the code or type it in?


If you pasted it, the quotes might be the wrong encoding.