Tilt Monster (formerly known in the App Store as Doodle Dash!) was the FIRST project of Jonathan Beebe, and was one of (if not THE) first Corona SDK game to reach over 100,000 sales in the App Store!
(Special thanks to Biffy Beebe for the artwork/graphics assets, and her ideas and inspiration throughout the development process--this is the project that did it for us!)
Now YOU have access to the complete source code of the game, for you to learn from and/or use it as a framework for your own projects.
Tilt Monster is still live in the App Store right now (free), so if you use this game's source code, you should definitely swap the graphics out with your own (and of course, change the name!).
The source code was released so you can see a COMPLETE game--not just Sample Code--that was live and selling in the App Store, so you have a **proven** project to learn from when creating your own games.
---
Note from Jonathan:
This was my very first Corona project, and it has served as an EXTREMELY valuable learning tool. I hope you find as much value in this project as I have, and I look forward to your contributions via GitHub. Enjoy!
---
Wow, you are awesome!
thankyou :)
That is really a great help to the community. You're the best!
Let me just say Thank You so much for this. I am at the finish line of my own game and I was actually hoping for something like this. While it is great to see all of this code out here, the value of a finished game that is in the app store is tremendous.
The big thing I wanted to see is how you take care of memory management.
This is one of the most important things and sadly one of the least covered on this site. I would love if someone with experience on this topic could make a detailed tutorial all about memory management. (Many people talk about their memory leaks. I am almost finished with my game and I STILL don't know how to check for leaks. My game tests fine on my iPhone 4 so I am hoping I'm good)
Anyway, thanks again!
Thanks Jon & Biffy for your generous sharing.
Thank you all for your comments so far.
@noahm26: have you seen the following page? It might help you out some. If you need more info, can you describe exactly in what area and I can write up an article on the topic (if needed); however, it might be enough:
http://developer.anscamobile.com/content/performance-and-optimization
@jonathanbeebe: Maybe I am worried about this more than I should be. I have actually adapted your clean function from ghost vs. monsters along with director class. My code is working nice and quick on my iPhone 4 but I haven't tested on an earlier device.
However, I have seen many people write on the forums that they are seeing memory leaks in their games. How do they know this? How do you check for a memory leak?
I know how to find errors using Terminal but not how to check memory leaks. Any info on that would be quite useful.
Thank you Jonathan for your generosity
Carlos
This is really great, thank you for sharing this.
I did find an issue that I have a question about. When I load the app for the first time, the music plays for the first game, but if I die and start the game again the music does not play. Does anyone know how to fix this issue?
Thanks for any help, and again thanks for sharing Jonathan!
Kevin
@noahm26: I just posted a new article to my blog that covers memory management, and how to track memory leaks:
http://jonbeebe.net/corona-sdk-memory-management-101-tag-memory-m
Also, as of the last stable Corona release, you no longer need that cleanGroups script I provided in the past. There have been changes to the Corona core that cleans up child objects from groups automatically when you call display.remove() and removeSelf().
Hope that helps!
@ jonathanbeebe:
And there it is.
That is exactly what I was looking for. Ansca should make that article the front page on their docs section. Great job explaining everything.
You are truly a unique person for being so helpful and generous with your knowledge and time. It is very much appreciated!
Thanks!
@jonathanbeebe: You truly are a gem in this community. I learned so much from Ghosts vs. Monsters and your blog (if you haven't read it, go read it right now - http://jonbeebe.net/) that I cannot wait to go through the sample code.
Thank you very much!!! All of the available source code you guys have provided has helped me learn more about the Lua programming language and enable me to put my own twist in the apps I'm developing. I've learned so much in such a short amount of time. :D
Tilt Monster was the game that convinced me to go with Corona in the first place. Thanks so much for sharing, Jonathan (and Biffy!)
Thank you Jonathan fro being very generous. This is an inspiration and assist for those new to this field. To have a complete source code of a full working app is so incredible! Thanks again!
It's so great that You give to all of us a new "step forward" to learn more with this fantastic "developer tool" from Ansca Mobile.Thank you ,Thank you,Thank youJonathan!!!
@jonathanbeebe: THANK YOU! I have learned SO much from your code! I have to admit, I could not believe it when I first saw that you were release your code. But I am so glad you did. So again thank you so much.
After looking at your code for a long time, I am just curious about one thing. The clean() function. It seems that you clean mostly Runtime events but not display objects like background images and so on? Your apps works great on both Android and iPad so you must be doing something right (LOL) So I am wondering if I am not doing something wrong!
Right now each of my modules (menuScreen, optionsScreen, gameScreen and so on) have a clean() where I not only cancel Runtime events but also try to delete display objects using your method (from you site) which display.remove()
My question: Is is necessary to explicitly remove display objects when exiting each module? Your code seems to say no but I just wanted to make sure. by the way I am using Director 1.2 right now.
In any event, let me again says THANKS for not only the code but also your willingness to help this community. You are of course an asset!
Mo.
ps: anybody can comment on this issue of course.
@lemsim: I'm glad you are getting a lot of value out of the code!
The reason I don't remove display objects with the clean function, is because when a screen is transitioned, it removes the display group, which actually removes all of the children objects within that group.
So for future reference, if you have a group, and you add objects to that group, when you call removeSelf() (or display.remove()) on the group, all the children objects will be removed as well.
Runtime event listeners, however, do not get removed automatically (ever), so that's why I do it manually in the clean function.
Thanks again for your comments.
Hey. You are really welcome!
Just to make sure (i m sorry if I am dense today!) Do I still need to use display.remove() in my clean()? You seems to say that display.remove() on a group will remove all the children objects BUT do I need to actual use that if I am using Director 1.2? my feeling is no and that Director removes all groups and objects at screen switching (but not Runtime listeners and transitions for instance)
Am I correct to think that?
Thanks for your super fast answer by the way!
Mo
Yup, you've got it. Director will remove all objects, as long as you added those objects to the screenGroup (or localGroup I think is the default for director screens).
Remember though, if you have any runtime listeners, such as enterframe listeners or runtime touch listeners, you need to manually remove those.
Basically, anytime you have this in your code:
Runtime:addEventListener...
You need to have:
Runtime:removeEventListener...
Somewhere else or you're risking some major crashes. Display objects and their attached non-runtime listeners will get removed when you remove their parent group though :-)
Hope that helps!
ABSOLUTELY it helped! Thank you so much for getting back to me so rapidly. I appreciated it very much. It all make sense now.
THANKS.
Mo.
How can i add more life to the game?
And did someone fix audio bug when hit play again button background music stop?
Thanks
Thank you for Tilt Monster code Jonathan someday I will buy a beer for that. Now my lua learning process increased twice.
Thanks very much for this Jonathan
Is there a way to control this game on an emulator?
Hi
I must be missing something.
I downloaded the files and all I get are images.
What have I done wrong ?
Iain
can I use the code for making my game, with changing images and some properties of the game ??
THank u to much for the code, very helpful
You are free to do what you want with the code/images, etc. :-)
For a variety of products we are working on at http://VisualsWork.com we plan on incorporating many of the features and game play of Jonathan and Biffy Beebe's (http://beebegames.kodingen.com/) open sourced Tilt Monster app ( http://developer.anscamobile.com/code/tilt-monster).
In an effort to complement Jonathan and Biffy Beebe's amazing generosity; as we learn from their work I plan on providing examples and source code of various aspects of the game at: http://www.pahgroup.com/index.php/blog/7-tilt-monster-open-source/
Best wishes,
Paul Allan Harrington
Visuals Work: { visualswork.com }
Consulting Group: { pahgroup.com }
@Jonathan
First of all, thanks for that great sample of successful game.
Why i don`t see it or any other game of Beebe Games in App Store ? You are on a vacation ? XD or developing the next hit ?
Thanks man so much!!!
Any ideas on how to increase the number of lives?
I am really very bad playing this ; ))P
I will need a very-very-easy settings just for me!!
lol
Somebody knows how to dont show the rating message?
Thanks.
@omarcaleroherrera2
Take a look at the startGame function in main.lua at line 90. Jonathan did a nice job commenting the code so it should be fairly easily to determine which lines of code to remark out and/or delete.
If I'm correct, I believe you could remark out and/or delete lines 91 - 133.
I did some lite testing and the above worked out successfully. If you have the Corona Simulator "Show Project Sandbox" (File | Show Project Sandbox), you'll be able to look at the rating.data file that is created to track the number of times the app is opened. Jonathan has the app set to request a rating on the 4th attempt. Deleting or remarking out lines 91 - 133 will no longer create and modify the rating.data file, so deleting it (rating.data) and making your code changes will help you determine if your on track. The file should not reappear if you make the correct modifications.
Best wishes,
Paul Allan Harrington
Visuals Work: { visualswork.com }
Consulting Group: { pahgroup.com }
Thank you Paul
After...
settings =
{
orientation =
{
default = "landscapeRight",
supported = { "landscapeRight", "lanscapeLeft" },
},
...
The game in general works well except the tilt that move in oposite way if "lanscapeLeft" : (((
Is there a way to control this?
@bebee, please HELP!! ; ))P
Thank you Jonathan an Biffy for this GREAT release!
Could someone please tell me how reverse the scrolling movement? Instead of everything going DOWN, I want everything going UP..
Thx
Why the in game music stop play when you restart the game, i mean retry the round ?
Edit: Never mind figured out my self.
@KeepTrying
Can you please share it? I have the same problem :(
Thanks!
Ok @info242 here we go, open maingame.lua and change runningSound by gameMusic3 on LINE 1317.
Everytime you start the game by default gameMusic3 is played, when you press TryAgain the runningSound is activated.
Many thanks for @jonathanbeebe because i'm not a programmer and that source code let me learn more and more everyday.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | -- Setup "Try Again" Button local touchTryAgainBtn = function( event ) if event.phase == "release" and tryAgainBtn.isActive == true then tryAgainBtn.isActive = false -- Play Sound >>> play sound active search local soundsOn = gameSettings[ "soundsOn" ] if soundsOn == true then local freeChan = audio.findFreeChannel() audio.play( tapSound, { channel=freeChan } ) local freeChan2 = audio.findFreeChannel() -- LINE 1317 audio.play( runningSound, { loops=-1, channel=freeChan2 } ) end recycleRound() end end |
Thanks KeepTrying! it is working...
BGM has not been played on my ipod touch after ios 5 update.
Does anybody have the same problem?
Anyone figure out how to reverse the direction of all objects.
Thanks
Hi everyone. I find the Martian Control code made by Jhonatan and Im trying to do the ships land in the planets without drawing a path, I mean, each planet be the goal of certain ships, so you have to touch them to destroy before they land. But I dont know how to do that. Any idea on how to do that?
Thanks
How Can I add more themes for use? I need to learn that for my new app...
all I can say is Thank you..
hi i am new in corona as well as game development. i am influenced by this code and if i want to develop the same code with just a small modification like moving bottom to up of the objects. how do i do this.
Thanks & Regards
I had a question about the facebook part. For my app I wanted to have a post score to facebook but I had a problem: Failed to index global function "facebook" on last line and in function "on event"
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | local touchFBBtn = function( event ) if event.phase == "release" then -- BELOW IS AN EXAMPLE OF HOW TO GET FACEBOOK SCORE POSTING TO WORK: -- Play Sound local soundsOn = gameSettings[ "soundsOn" ] if soundsOn == true then local freeChan = audio.findFreeChannel() audio.play( tapSound, { channel=freeChan } ) end -- local facebookListener = function( event ) if ( "session" == event.type ) then -- upon successful login, update their status if ( "login" == event.phase ) then local gameScore = getScore() gameScore = comma_value(gameScore) local theMessage if gameSettings[ "difficulty" ] == "easy" then theMessage = "just scored a " .. gameScore .. " on Alien Falls (Easy Mode)." elseif gameSettings[ "difficulty" ] == "medium" then theMessage = "just scored a " .. gameScore .. " on Alien Falls (Medium Difficulty)." elseif gameSettings[ "difficulty" ] == "hard" then theMessage = "just scored a " .. gameScore .. " on Alien Falls (Hard Mode)." end facebook.request( "me/feed", "POST", { message=theMessage, name="Download Alien Falls to Compete with Me!", caption="Think you can beat my score of " .. gameScore .. "? I dare you to try!", link="http://itunes.apple.com/app/alien-falls/id506423125?mt=8", picture="http://tiwwas.com/wp-content/themes/FBAPPICON.png" } ) end end end -- replace "---" below with your Facebook App ID facebook.login( "***************", listener, {"publish_stream"} ) end end <code> to clarify the issue is on line "########", listener.... any idea what i did wrong or how to fix it? |
Keep up the great work mate!