• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

112 Neutral

About CoronaRob

  • Rank

Personal Information

  1. From the Forum – Issue #178

    Welcome to this week’s From the Forum. In this post, we highlight a few Corona Community Forums posts that cover important topics. Spamming buttons Sometimes repeated button presses are okay, but frequently they’re not. How do you defend against them? In this thread, our developer community chimed in with some different ways to prevent rapid button presses. Wow, that was fast! We just announced HTML5 builds in open beta this week and our ever-diligent community developer @develephant has already started creating useful plugins. Check out this thread to get an easy to use Cookie Set/Get/Delete plugin. Daily quests? Many games offer players daily tasks to complete. That’s a great way to get players to engage with your app daily and keep them involved with your app. But how do you implement them? Learn a couple of ways of approaching the task in this thread. Do you have a particular forum thread that was helpful for you? Let us know about it! Email support@coronalabs.com, put FTF: and the forum title in the subject, and include the URL in the email. We will consider adding it to an upcoming edition of From the Forum. View the full article
  2. Making HTML5 plugins for Corona

    HTML5 opens up some great opportunities for developers and one of those is plugin development using JavaScript. While most Corona developers will only use Lua in a cross-platform manner like they are currently using, it’s super easy to add JavaScript features to extend your app. You need two things: a .lua file that tests to see if your platform is HTML5 or some other platform and the actual JavaScript .js file. If you detect you are an HTML5 build, then you require the JavaScript plugin, else provide default functions that prevent those calls from creating errors for the non-HTML5 builds. Consider this code: -- -- myplugin.lua -- Copyright (c) 2018 Corona Labs Inc. All rights reserved. -- local lib local platform = system.getInfo("platform") if platform == 'html5' then -- use native JS plugin lib = require("myplugin_js") else -- wrapper for non web platforms local CoronaLibrary = require "CoronaLibrary" -- Create stub library for simulator lib = CoronaLibrary:new{ name='myplugin', publisherId='com.mydomainname' } -- Default implementations local function defaultFunction() print( "WARNING: The '" .. lib.name .. "' library is not available on this platform." ) end lib.set = defaultFunction lib.get = defaultFunction lib.addEventListener = defaultFunction end -- Return an instance return lib If you’re on HTML5, it includes the JavaScript plugin. If not, it simply lets the app know the function isn’t available. Plugins have to have a unique namespace and that’s accomplished by this line in the .lua file: lib = CoronaLibrary:new{ name='myplugin', publisherId='com.mydomainname' } Obviously if you intended to publish this to the Corona Marketplace, or if you want to use multiple plugins in your code, the name needs to be unique. Change “myplugin” to a proper name. Then set publisherId to the reverse domain name you use to publish with. For instance, Corona Labs made plugins would have a publisherId of “com.coronalabs“. Then you create a plugin with the same name except with an _js as part of the name. For instance if your plugin is “awesometimer.lua“, you would create “awesometimer_js.js“. This file will contain your JavaScript code. Here is an example: // // myplugin_js.js // Copyright (c) 2018 Corona Labs Inc. All rights reserved. // // JS plugin is an child object of 'window' window.myplugin_js = { // all the 1st-level functions are available to call from Lua // so 'get' and 'set' functions are available to call from Lua data:{}, // function may use up to 10 args; use Object or Array if you want to pass more than 10 args // arg maybe a Number, String, Boolean, Array or Object set: function(bool_arg, number_arg, string_arg, table_arg, array_arg) { console.log('js set() is called'); var data = window.myplugin_js.data; data.bool_arg = bool_arg; data.number_arg = number_arg; data.string_arg = string_arg; data.table_arg = table_arg; data.array_arg = array_arg; // Lua callback // you can pass to Lua a Number, String, Boolean, Array or Object args this.dispatchEvent({ name: 'onData', data: { arg1: bool_arg, arg2: number_arg, arg3: string_arg, arg4: table_arg, arg5: array_arg }}) console.log(typeof(bool_arg)); console.log(typeof(number_arg)); console.log(typeof(string_arg)); console.log(typeof(table_arg)); console.log(typeof(array_arg), array_arg.length); }, get: function() { var data = window.myplugin_js.data; console.log('js get() is called', data); return data; } }; console.log('myplugin_js is loaded'); We of course can’t teach you JavaScript in this tutorial and there are plenty of examples on the Internet to see. The main point is that you add your plugin to the JavaScript window object, provide your functions as part of the plugin namespace and add your methods to your plugin object. Then in your .lua modules, i.e. main.lua, you can require the plugin and call the functions as necessary. -- -- main.lua -- Copyright (c) 2018 Corona Labs Inc. All rights reserved. -- -- A sample of using JS native plugin for Corona local widget = require( "widget" ) local json = require( "json" ) local myplugin = require("myplugin") local label = display.newText( "output", 50, 220, native.systemFont, 16 ) label.x = display.contentCenterX local data = native.newTextBox(160, 360, 320, 250) data.isEditable = false -- JS event listener. local function pluginListener( event ) local str = json.prettify(event) str = 'got event from JS plugin:\n' .. str print(str) data.text = str end local setData = function() -- call JS native plugin -- arg value maybe boolean, number, string, table -- local bool_arg = true local number_arg = 123 local string_arg = 'abc' local table_arg = {key1='key1value', key2={1,2,3}} local array_arg = {1,2,3,4,5,6,7} myplugin.set(bool_arg, number_arg, string_arg, table_arg, array_arg) end local getData = function() -- call JS native plugin local tbl = myplugin.get() if tbl then local str = json.prettify(tbl) -- Important: use index-debug.html if you want to see print output print('Data: ', str) data.text = str end end -- event listener, it's an option myplugin.addEventListener(pluginListener) widget.newButton { onRelease = setData, left=60, top=60, width=200, height=50, label = "Save Data in JS", labelColor = { default={ 1, 1, 1 }, over={ 0.6, 0.6, 0.6 } } } widget.newButton { onRelease = getData, left=60, top=120, width=200, height=50, label = "Read Saved Data", labelColor = { default={ 1, 1, 1 }, over={ 0.6, 0.6, 0.6 } } } -- This example shows you how to call functions to get data, set data as well as dispatch events from JavaScript back to your Lua code. You can download the complete sample project from our GitHub repository. If you have questions please reach out on our HTML5 forum! View the full article
  3. Good news! Today Corona is pleased to announce that HTML5 builds are in “Open Beta”. That means starting with daily build 2018.3238, you can now have Corona output a folder with the various HTML files and content necessary to run your Corona game or app in a web browser. Simply upload the entire folder to your web server and access that folder through your HTML5 compatible browser. Due to JavaScript security restrictions, HTML5 builds only work if they are served from a web server. If you have Python installed you can test locally by starting a web browser on your computer and accessing your HTML5 build folder in your browser. The easiest way to get it served on macOS is to drag your build folder on to Terminal.app then paste python -m SimpleHTTPServer into the terminal window. Then open http://localhost:8000/index.html in you web browser. For Windows, with Python installed, run cmd.exe and then use the cd command to change directories to your build folder and run the same Python command and then open your browser to the above URL. If you need to see the console log, please open http://localhost:8000/index-debug.html instead. If your app makes calls to web servers, using API’s like network.request(), because of JavaScript cross-domain scripting rules, you can’t directly call REST type APIs. Instead you will need to write a local web script on the same domain that will make your REST API calls and then echo the returned data back to network.request(). We have opened a forum to discuss HTML5 builds. Please discuss your observations in the HTML5 forum. Because this is still a beta product, we don’t recommend releasing your game the public yet. If you do, you should heavily test your game or app before releasing it. HTML5 build behavior is subject to change as we continue to work to bring it to a release status. Most all current Corona-made and third-party plugins are not HTML5 compatible at this time. Many of our ad providers do not offer HTML5 SDK’s for us to build plugins against. Other plugins will take time for us to build HTML5 compatible versions where possible. For plugins in our Marketplace built by our community developers, it will be up to them to offer HTML5 plugins where possible or update existing plugins with HTML5 stubs where not possible. A tutorial on creating HTML5 plugins is coming soon. This is a huge milestone for Corona. It will open the door for you to reach more consumers. It will make it easier to show your work off to early testers, prospective clients and more. Even game jams will rock even more. Our goal is to get this out of beta by the next public release where we will be including some other great features. Please let us know your thoughts in our HTML5 forum. View the full article
  4. From the Forum – Issue #177

    Welcome to this week’s From the Forum. In this post, we highlight a few Corona Community Forums posts that cover important topics. Physics and groups Groups are a wonderful way to organize your display objects but sometimes this can create issues for developers using physics. @roaminggamer and @horacebury contributed to a thread that explains the problem and offered up some solutions. Loading large scenes Doing tasks in Corona can take time. When you do many tasks in a row, your user interface will block. This can make loading large scenes appear as if your app has frozen. A standard tactic would be to show a progress bar. However, Lua is a single-threaded language that can make it difficult to avoid blocking and allow your progress bar to update. In this thread, several Corona developers jumped in and offered suggestions on how to manage loading a large number of assets. Making an accordion widget There are many different ways to present data to users. A popular web technique is an accordion style display where you click on an item and it expands to show more information. Building this in Corona can be a bit tricky since you need to know the height of other objects to move them around to open space for the added info. In this thread, our wonderful community of developers joined to solve the problem. Do you have a particular forum thread that was helpful for you? Let us know about it! Email support@coronalabs.com, put FTF: and the forum title in the subject, and include the URL in the email. We will consider adding it to an upcoming edition of From the Forum. View the full article
  5. Changes to our feature request site

    We have made a change to our feedback site where feature requests are made. Before, you had 15 votes that you could spread among the items you felt were the most important to you. Now, vote limits are gone. When you click the “Vote” button, you will cast a single vote for the feature request. Clicking again will undo your vote. With this change, you can vote on any number of items. http://feedback.coronalabs.com View the full article
  6. Recent virus reports

    Some of our Microsoft Windows customers who run a couple of virus/malware checking software have noticed that our installer was testing positive for a Other:Malware-gen [Trj] alert. Avast and AVG were flagging this. ESET and Fortinet reported a PUP or “potentially unwanted program” for a web-bar they detected. The other 51 virus tools reporting to virustotal.com gave Corona a clean bill of health. What was the cause of these? Corona’s installer included a file named dma.dll. This file was part of the DeskMetrics library, an analytics service we used to help collect crash reports. The dma.dll file is actually harmless, but to remove any doubt, we have removed this file from our Windows installer. This change goes live with daily build 2018.3226. If you’re concerned about the presence of this file in our installer, please update to 2018.3226 or later. View the full article
  7. From the Forum – Issue #176

    Welcome to this week’s From the Forum. In this post, we highlight a few Corona Community Forums posts that cover important topics. Glitches in Physics The original poster wanted to move an object around another like a moon orbiting a planet but the pivot joints were creating glitches in movement. Corona super programmer @davebollinger jumped in and provided some really great advice using various joint types to solve the problem in this thread. Cleaning up display objects Everyone wants to avoid memory leaks and make sure their app cleans up after itself. But how memory is released can be confusing. When are you required to nil an object? When does the system do it for you? What if it’s in a table? Multiple Corona developers jumped into this thread to clean up some misconceptions about cleaning up memory. More Rotation Another thread about orbiting: in this case, the poster was asking how to manage mass with the rotation and have potential escape velocity. @roaminggamer came to the rescue with some great examples including videos to help explain the process. Do you have a particular forum thread that was helpful for you? Let us know about it! Email support@coronalabs.com, put FTF: and the forum title in the subject, and include the URL in the email. We will consider adding it to an upcoming edition of From the Forum. View the full article
  8. After a lot of hard work, Corona is happy to announce the release of the StartApp plugin! Now, app publishers who use the Corona framework to build their mobile applications will now be able to easily integrate StartApp’s SDK to monetize their Corona apps. StartApp is an insight-driven mobile technology company that enables partners to turn data into fulfilling mobile moments. By creating innovative ways of exploring mobile users’ intents and behaviors, and of being smarter about responding to these factors, we help our partners optimize and better execute their strategies. Corona is excited to now enable its developers to monetize using StartApp SDK, ranked as the 3rd most popular monetization SDK behind only AdMob and Facebook Audience Network, according to SDK analytics firm Mobbo with over 1 Billion MAUs, over 400,000 app partners. Not yet a using StartApp monetization plugin? Start using it now! View the full article
  9. Programming Guide For Video-Gamers

    There are some great resources available on the Internet for just about everything. Making computer games is no exception. Sometimes we come across a great resource that we think you might benefit from. The site IT Hare offers up their Programming Guide For Video-Gamers. This guide contains links/bookmarks to many other resources for game making, broken into development topics and career topics. Thanks to Sarah A. from San Diego, CA, an aspiring game developer, for finding this resource for us. It’s a great example of the community helping each other. If you come across great resources that would benefit our community just drop an email to support AT coronalabs.com. View the full article
  10. If you haven’t peeked into the Corona Marketplace recently, it now offers dozens of plugins and assets, from art packs to audio tracks to useful utility plugins. Periodically, we will highlight a few exciting products which can help you develop your dream app using Corona. Halloween Skeleton Game 2D Character Sprite Halloween may seem like it’s a long time off, but now is a good time to start planning your fall games out. This collection of animated sprites for a pumpkin hero can get you started. Check it out! Synthwave Vol.2 Synthwave Vol.2 is a collection of sci-fi sounds from Nocturnal Animals, including music and sound effects that can be used in a variety of games. The pack contains 4 music tracks and 20 sound effects. Progress Ring The Progress Ring plugin from Jason Schroeder allows you to add customizable circular progress rings to your projects. They can be used for anything from health bars to timers to business apps. They can be added to your project in as little as one line of code. View the full article
  11. Featured game: Beasts Battle 2

    Beasts Battle 2 is the follow up to Beasts Battle from Greenolor Studio, primarily by Sergey Pomorin in Kaliningrad, Russia. Inspired by classics like Heroes of Might and Magic and the King’s Bounty series, Beasts Battle 2 is a turn-based strategy game that operates in one of two game modes: map mode where the player explores the world and battlegrounds mode in which each battle occurs. During game play you will visit 10 original locations with colorful and diverse battlefields where you will encounter over 40 enemies that will challenge you with special abilities. You will collect unique artifacts, spells and build up your player’s skills while completing the main quests and additional side quests as you explore the world. Beasts Battle 2 is available for Windows desktop through Steam for $9.99. View the full article
  12. From the Forum – Issue #175

    Welcome to this week’s From the Forum. In this post, we highlight a few Corona Community Forums posts that cover important topics. Building a Reversi-like game Board games like Reversi (or as it’s trademarked Othello) are a common target for computer games, but how do you go about making one? The original poster was curious how to implement it in Corona. Long time Corona developer xnailbender jumped in and provided some board game handling code in the thread. Going pixel-perfect There are too many different devices to make pixel-perfect games but that didn’t stop Corona mega-developer Dave Bollinger from trying. He’s been publishing a developer blog and sharing it with the community in this forum thread. Pseudo-global trick or not? Code organization is important and breaking your code up into modules is a way to do so; however, it can become cumbersome to include a bunch of modules in each other. In this thread, several developers jumped in to offer suggestions on how to make this process more manageable. Do you have a particular forum thread that was helpful for you? Let us know about it! Email support@coronalabs.com, put FTF: and the forum title in the subject, and include the URL in the email. We will consider adding it to an upcoming edition of From the Forum. View the full article
  13. Featured game: The Guides Axiom

    In 2015, Kansas City developer Kevin Bradford and art director Luke Lisi put out a beautiful puzzle game The Guides. The Guides received high accolades from many including Apple’s “15 Most Mind-Bending Puzzlers” and CNET’s “Best Mobile Games of 2015“. The team has followed this hit up with a sequel The Guides Axiom. It has over a million downloads and has been featured in Apple’s “New Games We Love” category and Google Play’s “New Indie Highlights” category just after its release in September, 2017. It’s a beautiful, well-crafted game that provides the player various puzzles to solve and ciphers to decode, presented in unique and challenging ways. The game contains over 50 meticulously-designed challenges with more on the way. It also features nonlinear game play allowing you to explore the game at your pace and interest. Luke and Kevin hate “pay to win” games, so they have set up a unique support system based on how much you like or love the game as well as being able to buy “hacks” to help when you get stuck. The Guides Axiom is available on Apple’s App Store, Google Play and Amazon as a free download. View the full article
  14. 2D Game Engine Advice

    I'm a little late to finding this thread, but if you're still looking for a 2D engine, consider Corona. It's been around since 2009 and has a very easy to use set of API calls that are based on Lua. Check it out https://coronalabs.com Rob
  15. Announcing the new Appodeal plugin

    Many users love the Appodeal plugin. Having access to many ad providers in one place, getting high fill rates from the best advertisers is an awesome thing. However; that comes at a price. The plugin is large… It has to include the SDKs for every provider in the plugin. Today we are announcing a new beta version of the plugin. This new version is modular. After you include the base plugin in your build.settings, you then include the adapters for the various ad types that are important to you in your build.settings allowing you to customize your Appodeal experience. Of course you can use every ad type but doing so will have the same size requirements as the legacy Appodeal plugin. To use this new plugin, you would alter your build.settings to something like: settings = { plugins = { -- Base ['plugin.appodeal.base'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.AmazonAds'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.GoogleAdMob'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.TwitterMoPub'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.StartApp'] = { publisherId = 'com.coronalabs' }, -- Banner ['plugin.appodeal.AppLovin'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.FacebookAudience'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.Flurry'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.InMobi'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.MyTarget'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.MillenialMedia'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.Yandex'] = { publisherId = 'com.coronalabs' }, -- Interstitial ['plugin.appodeal.AdColony'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.AppLovin'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.Chartboost'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.FacebookAudience'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.Flurry'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.InMobi'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.IronSource'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.Mobvista'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.MyTarget'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.StartApp'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.MillenialMedia'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.Ogury'] = { publisherId = 'com.coronalabs' }, -- Rewarded Video ['plugin.appodeal.AdColony'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.AppLovin'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.Chartboost'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.FacebookAudience'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.Flurry'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.InMobi'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.IronSource'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.Mobvista'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.MyTarget'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.StartApp'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.Unity'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.Vungle'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.Tapjoy'] = { publisherId = 'com.coronalabs' }, }, } The example above includes all the entries you can use. If you want a lighter footprint, simply exclude the ad types you don’t need. The legacy Appodeal plugin will stay in place for now, but eventually this model will become the primary use of the plugin. We will manage a two-plugin model going forward, a “release” model and a “beta” model. For now, the legacy plugin is the “release” version and modular version is the “beta” version. We encourage people to try the modular version and provide us feedback on the plugin. View the full article
  • Advertisement