Corona Cannon - Newbie Questions

Hi,

1-Where in the code is possible to put a zoom out and put the screen static like displaying all screen instead of just one part of it ?

2-How to put more lives/balls than the 2 default ?

Thanks very much

https:// github.com/ corona labs-samples/ CoronaCannon

np5dias, hi.

First, let’s start with the easy one. You can add more balls by adjusting level files.
https://github.com/coronalabs-samples/CoronaCannon/tree/master/levels
Open them and add more elements to the ammo table. Values are either ‘normal’ or ‘bomb’.
As you can see, it controls not only the amount of balls, but also their sequence.

Zoom, on the other hand, is very tricky. I decided not to include the zoom logic into the game, because it greatly complicates the code.
You can add a new field to self.camera, something like self.camera.zoom and depending on that value you adjust the scale AND position of self.group. It’s quite tricky, but that’s enough to get going.
https://github.com/coronalabs-samples/CoronaCannon/blob/master/libs/tiled.lua
 

hi lerg
how can I add more levels please…
I need to know.

Thank you
https://github.com/coronalabs-samples/CoronaCannon

You can set level count in main.lua

https://github.com/coronalabs-samples/CoronaCannon/blob/master/main.lua

composer.setVariable(‘levelCount’, 10) – Set how many levels there are under levels/ directory

You also need to create another level file in here

https://github.com/coronalabs-samples/CoronaCannon/tree/master/levels

note I don’t believe the layout of my level select can handle more than 10 levels so you may need to make some adjustments

np5dias, hi.

First, let’s start with the easy one. You can add more balls by adjusting level files.
https://github.com/coronalabs-samples/CoronaCannon/tree/master/levels
Open them and add more elements to the ammo table. Values are either ‘normal’ or ‘bomb’.
As you can see, it controls not only the amount of balls, but also their sequence.

Zoom, on the other hand, is very tricky. I decided not to include the zoom logic into the game, because it greatly complicates the code.
You can add a new field to self.camera, something like self.camera.zoom and depending on that value you adjust the scale AND position of self.group. It’s quite tricky, but that’s enough to get going.
https://github.com/coronalabs-samples/CoronaCannon/blob/master/libs/tiled.lua
 

hi lerg
how can I add more levels please…
I need to know.

Thank you
https://github.com/coronalabs-samples/CoronaCannon

You can set level count in main.lua

https://github.com/coronalabs-samples/CoronaCannon/blob/master/main.lua

composer.setVariable(‘levelCount’, 10) – Set how many levels there are under levels/ directory

You also need to create another level file in here

https://github.com/coronalabs-samples/CoronaCannon/tree/master/levels

note I don’t believe the layout of my level select can handle more than 10 levels so you may need to make some adjustments