Appstore Blogs

Appstore Blogs

Want the latest?

appstore topics

Recent Posts

Archive

Showing posts tagged with Gamedev

July 08, 2015

Paul Cutsinger

On Wednesday’s installment of our live dev show we welcome Luke Burtis, Production Director from tinyBuild the indie game developer and publisher.  He’ll be sharing his perspective on our concept game “Planet Destroyer” and talking about success factors for indie devs. 

Please join the conversation on Wednesday July 8 at 11:00 am PST at http://www.twitch.tv/paulcutsinger.

For background, we’ve been talking a lot about how to get more game developers over the app poverty line and sharing best practices for building quality games and healthy businesses on the blog and at conferences.

Now, we’re doing something a bit different.

We’ve started a reality show called “Planet Destroyer: Concept to Greenlight” where @PeterDotGames and @PaulCutsinger are building a game live on Twitch and just, like any reality show, it’ll end with a panel of judges that will critique the game and will give it a thumbs up or thumbs down. Along the way, we’re broadcasting the entire journey live on Twitch. We really want that thumbs up so, to help us and all the game devs that watch, we’re bringing in experts from around the industry to mentor us on every aspect of building a game – game design, architecture, music, story, business models, crowd funding, publishing, user acquisition, art, front end coding, back end scale, marketing… Everything you actually need to have a successful game launch.

 

July 06, 2015

Paul Cutsinger

On Tuesday’s installment of our live dev show we welcome Starr Long, the executive producer of Shroud of the Avatar and director of Ultima Online. He’ll be sharing his perspective on our concept game “Planet Destroyer” and talking about MMO fundamentals, crowd funding and the power of connecting early with your fan base. 

Please join the conversation on Tuesday July 7 at 9:00 am PST at http://www.twitch.tv/paulcutsinger

For background, we’ve been talking a lot about how to get more game developers over the app poverty line and sharing best practices for building quality games and healthy businesses on the blog and at conferences.

Now, we’re doing something a bit different.

We’ve started a reality show called “Planet Destroyer: Concept to Greenlight” where @PeterDotGames and @PaulCutsinger are building a game live on Twitch and just, like any reality show, it’ll end with a panel of judges that will critique the game and will give it a thumbs up or thumbs down. Along the way, we’re broadcasting the entire journey live on Twitch. We really want that thumbs up so, to help us and all the game devs that watch, we’re bringing in experts from around the industry to mentor us on every aspect of building a game – game design, architecture, music, story, business models, crowd funding, publishing, user acquisition, art, front end coding, back end scale, marketing… Everything you actually need to have a successful game launch.

 

July 01, 2015

Paul Cutsinger

We’ve been talking a lot about how to get more game developers over the app poverty line and sharing best practices for building quality games and healthy businesses on the blog and at conferences.

Now, we’re doing something a bit different.

We’ve started a reality show called “Planet Destroyer: Concept to Greenlight” where @PeterDotGames and @PaulCutsinger are building a game live on Twitch and just, like any reality show, it’ll end with a panel of judges that will critique the game and will give it a thumbs up or thumbs down. Along the way, we’re broadcasting the entire journey live on Twitch. We really want that thumbs up so, to help us and all the game devs that watch, we’re bringing in experts from around the industry to mentor us on every aspect of building a game – game design, architecture, music, story, business models, crowd funding, publishing, user acquisition, art, front end coding, back end scale, marketing… Everything you actually need to have a successful game launch.

This week, we’re excited to have Luke Burtis from Tiny Build and Dmitri Williams from Ninja Metrics come on the show. Luke is going to share his perspective as an indie game developer that ran a successful kickstarter and Steam Greenlight and as an indie publisher that is looking for great games to publish. Dmitri’s brings a perspective on social analytics that is going is core to our game design. He’ll help us understand how to refine our conceptual ideas make them real and actionable.

 

June 30, 2015

Corey Badcock

Get Marketing Tips, Technical Advice and Best Practices Delivered to Your Inbox

Join our community of developers and subscribe to the Amazon Developer Weekly.

Amazon’s developer blog covers everything you need to grow your mobile app business. Get your dose of technical tips, industry insights, product announcements and app marketing best practices delivered to your inbox every Monday. Get articles like these and more when you subscribe:

  • Introducing the Alexa Skills Kit, Enabling Developers to Create Entirely New Voice Driven Capabilities
  • Why Isn’t Your Game Doing Better?
  • Free Video Training: Tips for Reaching New Customers with Your Android Apps

Signing up is easy. Click here to complete the form to subscribe by email today.

 

June 23, 2015

Jesse Freeman

When it comes to choosing the right framework to building your game with it’s not always an easy decision to make. If you are just getting started, knowing the long term viability and support is also difficult to predict. Over the past few years I’ve been making my own games in HTML5 and Unity. While both are very good platforms, picking which one is best for you isn’t always black and white. To help you out, I’ll be doing a special talk at our newly opened AWS Pop-Up Loft in New York City on June 29th at 12pm.

During this talk I am going to go over one of my own games, Flappy Jetroid, that I’ve built in HTML5 using the popular Phaser game framework and Unity.

Phaser version of Flappy Jetroid

Unity version of Flappy Jetroid

We’ll dig deep into the code of each game, how they differ as well as the advantages/disadvantages of each. We'll also discuss publishing options for both platforms and how to create truly cross platform games from a single codebase.

You can register for the talk on the AWS Pop-Up Loft website or directly here.

Looking to learn more about making games in HTML5 or Unity for Amazon Appstore? Check out the following resources:

- Jesse Freeman (@jessefreeman)

 

June 09, 2015

Jesse Freeman

In part one we covered techniques for getting started with a new project. In this post we’ll go over staying motivated to finish the game.

Knowing When to Take a Break

We all hit that wall when it comes from pushing ourselves a little too hard, setting unrealistic goals. When this happens it’s best to just walk away and take a break. How long is up to you. I find that sometimes I’ll work on two games at the same time, switching between them when things start to feel like they are dragging or I am losing interest. If you plan the games correctly you can build one off the other and end up with reusable code to can be shared between both.

Sometimes a difficult issue that needs to be solved is so complex you lose interest all together. You’d be surprised how much a short break, even for a few days, will clear up your head. One thing I suggest, especially if you are like me who puts stuff aside to work on at a later date, is to comment your code as much as possible. You may find it annoying at first but there is nothing worst than coming back to a project after a month and have no idea where you left off.

The Ever Growing Task List

I am a list maker. Everything I need to do in my game goes into a task list. It’s an old habit from my enterprise development and SCRUM days where I would create a two-week plan and fill in a backlog of tasks. The same technique can apply to game development too.

I like OneNote since it lets me mix and match task items with checkbox as well as text and pictures. I’ll save everything about the project into a single task list with references so I don’t forget why I made that task. Over time I check off what I’ve done and move it to the bottom of the list. On slow days I can reorganize the list to help me find things to work on. On crazy days where the list is too long I’ll simply focus on the top five items and see what I can go from there.

In the end, the list allows me to block out my workday. I can see how much I have left to do, track ideas I want to add to the game over time, and help motivate me to keep going. Also completing a checklist gives you a real sense of completion. I sleep better at night after seeing the progress made on the list at the end of each long day. I also like to plan out the next day the night before and make sure my most critical issues are always at the top when I get back to my project.

Share Your Project With Others

One of the biggest motivations techniques I have is to share the project with others. While it’s always a challenge getting feedback, it helps to see what others think about your game. The sooner you have a playable copy the better. Getting early feedback and doing player testing is critical to build the game others want to play. It's important to not box yourself into features only you find interesting.

I leverage social networks like Twitter and Twitch as much as possible. These places are also helpful if you are not ready to let people play the game on their own. It may feel silly but be sure to include special hash tags when tweeting out updated to your game. The best one to use is #gamedev. Also take part in #screenshotsaturday by sharing updates of your game’s progress each Saturday. I’ve been picked up a few times by indie game magazines because of this.

Right now, Twitch is not as far reaching for game development updates as Twitter. The power of Twitch is that once you build up a dedicated following it can creates a community around your game way before it even launches. Also, I've found that some of the best advice both technical and on my game play comes from the live chat during my stream. Find ways to include viewers in the conversation. You'll see the quality of the comments will go up the more engaging you and your game are during the stream. Twitch even has a dedicated game development channel. Check out one of the highlights I captured from a stream where I Skyped in Mike Geig from Unity to figure out how to handle abstracting controller input in my game.

Real Artist Ship

The final stages of shipping a game are more than just fixing bugs. It involves perseverance, determination and vision. While all of these techniques work well for me I've had years of experience to fine-tune them for my own workflow. The hope is that you find your own ways to motivate and reinforce these traits for finishing your next game from this talk. In the words of Steve Jobs, "real artists ship!"

If you missed part one, make sure to check it out as well as the following links covering game design for beginners:

Part 1 - Picking a Framework

Part 2 - Game Design 101

Part 3 - Creating Artwork and Sounds

Part 4 - Polishing Your Game

Part 5 - Publishing and Marketing Your Game

 

-Jesse Freeman (@jessefreeman)

June 05, 2015

Jesse Freeman

We recently released a new version of our In-App Purchase SDK for Unity Developers. The Amazon In-App Purchasing (IAP) API makes it easy for you to offer digital content and subscriptions for purchase within your app, such as in-game currency, expansion packs, upgrades, consumables, and more on Fire OS and Android devices. The latest version, IAP v2.0, leverages new features to better support Android OS 5.0 (Lollipop), work with our newer App Tester and better integration with the Amazon Appstore. If you have already been using the SDK in Unity, or looking to add it for the first time, it’s also straight forward to implement.

To get started, you need to download the package from our Unity plugins page here.

Once you have downloaded it, you’ll be ready to get started.

Step 1: Importing the Package

After downloading the Apps-SDK, open your Unity project and click on the Assets menu, then select Import Package -> Custom Package from the drop-down.


Navigate to where you downloaded the AmazonIAP.unitypackage, which you can find inside of the Unity folder of the Apps-sdk folder and select it. You’ll then be presented with the import window.


From here you can install all of the files and it will setup your project to include the Unity classes as well as the native Android code you’ll need to run on an actual device.

Step 2: Set Up Your Game on the Developer Portal

If you have not already registered your game, you’ll need to log into the Amazon Developer Portal and add your game. Click “Add a New App” to begin the process of submitting it to the Amazon Appstore or select your existing game.


Step 3: Create New In-App Purchasable Items

Before you can leverage any IAP calls in your game, you’ll need to create new purchasable items in our portal. You can follow this walkthrough, which will guide you through the process.


After you have created a few items, you can leverage the IAP v2 plug-in methods and events here in Unity directly or check out the sample project.

Step 4 (Optional): Set Up Test Environment

At this point you are ready to begin using IAP in your Unity game. In order to make sure everything is configured correctly, you’ll want to download Tester Tool.


Once you have the Tester Tool. You can follow these steps to learn more about the IAP testing process and configuring your testing environment.

Step 5: Submit Your App

It’s free to be a developer on the Amazon Appstore. Once your game is ready, simply push it live and reach millions of Android customers in 236 countries and territories worldwide across Amazon Fire and Android devices.

Conclusion

In-App purchases are a great way to not only monetize your game but also offer additional content to players in order to extend replay and engagement. We are working hard to make sure the process is seamless for Unity developers looking to take advantages of the features offered by the Amazon In-App Purchase V2 API. For more information on the IAP v2 check out the following links:

- Jesse Freeman (@jessefreeman)

 

June 03, 2015

Jesse Freeman

We've all been there; the last part of any project can be the hardest part. Tom Cargill said "The first 90 percent of the code accounts for the first 90 percent of the development time. The remaining 10 percent of the code accounts for the other 90 percent of the development time". When making games it can sometimes feel like your project will take super human strength to complete. While the last 10% of your project can be a struggle, it doesn't always have to be. In this post I'll cover some of my own strategies to stay motivated, focused and ship a game on time.

Starting From Scratch

Before we talk about the end of a project, let's talk a little bit about starting one from scratch. When I used to paint I found the hardest part was just getting started. I would look at a blank canvas for hours waiting until it to told me what to do. It never did. That’s why it’s up to you to motivate yourself when you start a new project. It’s important to have a plan before you build any game. Just like you wouldn’t build a house without a blue print you should have some details on what you are going to build.

To get started, I suggest creating a GDD (Game Design Document). If you are a sole developer, a GDD doesn't have to be pages upon pages of intricate detail about the game.  It's ok to be fluid in your design, just make sure you have some description of what you actually plan on building. That's why I suggest going with something a little simpler like Javi Cepa’s (@JaviCepa) 1 page GDD. It’s a great way to sketch out a simple game idea and remove the anxiety of the blank canvas to help you find direction.

Be Creative Every Day With 30 Minute Code Warm-Ups

Even if you have your game started, or you are just getting started, you’ll need a way to stay motivated. Going back to my years of fine art training I remember my mentor always made me do 30 minutes of drawing before I even touched a canvas. It was a great time to clear my mind and wake it up. I’ve used the same technique for coding over the years and call it Code Warm Up.

The basic idea of a Code Warm Up is to spend at least 30 minutes of the beginning of your day just coding. It doesn’t have to be anything you plan on keeping or incorporating into your own game. It could simply be an idea you had the night before or a particular game mechanic you’ve always wanted to try building. What ever you create during this time is temporary and in the moment. When you finish you can go back and clean it up or just scrap it. I keep all my experiments in a folder to go back to for inspiration when I am having trouble finding it.

The Pomodoro Technique

The day to day management of staying focused during a long project can be especially daunting. I’ve tried several techniques over the years to work with the ups and downs of my focus. It's also critical for me quickly motivate myself to code in the short windows of time I have between meetings, travel and family. For the past few years I’ve been having great success with the Pomodoro Technique.

The Pomodoro Technique focuses on setting a timer for 25 minute with a 5 minute break in-between. You can alter this to your own liking as well. I like to also take longer 15-minute break every 3 breaks. These short breaks force me to get out of my chair and stretch as well as pressure me to come up with a quick solution to a problem as I see the counter getting close to break time. I am even using this technique to write this post. I use it throughout the day to block off my time into more focused tasks which are not as much fun as making the game itself.

To Be Continued

In part two we’ll talk about when to take breaks from your game, keeping track of tasks and sharing your project with others to stay motivated and focused.

Looking for more resources on game design? Check out the following posts:

Part 1 - Picking a Framework

Part 2 - Game Design 101

Part 3 - Creating Artwork and Sounds

Part 4 - Polishing Your Game

Part 5 - Publishing and Marketing Your Game

-Jesse Freeman (@jessefreeman)

 

April 22, 2015

David Isbitski

The Game Developers Conference (GDC) is the largest annual gathering of professional video game developers providing a place for the industry to collaborate, network and share best practices for creating compelling game experiences. This year Amazon hosted a full Developer Day with sessions that covered building Android games for our full line of devices, Amazon Echo, Fire Tablets, Fire TV and Fire Phone, how to build better cloud gaming experiences, reaching fans with Twitch, and applying in-app monetization best practices based on Amazon's IAP data.

These sessions were previously only available to GDC attendees, and we’re excited to announce that we’ve made all of the Amazon GDC Developer Day sessions freely available online. Enjoy!

An Overview of the Amazon Devices and Services for Game Developers
David Isbitski, Developer Evangelist, Amazon
Alf Tan, Head of Games Business Development, Amazon
Vlad Suglobov, CEO, G5 Entertainment

An overview of Amazon's current developer ecosystem.  Learn how you can take advantage of AWS services specifically targeted for Game Developers, Amazon's Appstore and the new line of consumer Fire devices like Amazon Echo, Amazon Fire TV, Fire TV Stick and Fire tablets, as well as monetization services such as in-app purchasing.  Plus, hear how G5 entertainment has had success on the Amazon platform from G5 CEO Vlad Suglobov.    

Top Tips for Porting Unity Games to Fire Devices
Jesse Freeman, Developer Evangelist, Amazon   
In this talk, we cover important tips for porting Unity games over to Fire TV, Fire tablets and Fire phone. Through code examples, we'll demo how to support multiple resolutions for pixel perfect Orthographic and Perspective Cameras, abstracting player input to support keyboard, controller and touch, and optimization tips for C# for the best performance. We'll also show how to deploy to our devices and get your game up and running on Fire OS. You'll walk away knowing what it takes to publish to the Amazon Appstore and help expand your game's user base.

How to Evolve Players into Fans
Peter Heinrich, Developer Evangelist, Amazon
We’ve analyzed the top mobile games to see what best practices make them stand out from the crowd. Several trends emerging now will amplify those best practices, and games will have more opportunity than ever to excel. In the future, the top games will have fully realized fan bases that will drive their user acquisition and engagement engines. That fan base will include players but also content creators, advocates and potential new customers — this will open up a wider range of monetization options.  Hear more about how top mobile games drive greater engagement and revenue and learn how to you can do this with your own game.

Build and Deploy Your Mobile Game with AWS
Dhruv Thukral, Gaming Solutions Architect, Amazon
Tara Walker, Technical Evangelist, Amazon 
Developing a successful mobile game today is about more than just the game:  Users expect backend services like user authentication, downloadable content, and social features. Using our AWS Mobile SDK for iOS and Android, it’s easier than ever to build a game with these services.  This session will provide a step-by-step approach to add features to your game such as user identity management, dynamic content updates, cross-platform data sync, and more.  We’ll demonstrate how to use the AWS Mobile SDK to securely interact with services such as Cognito, DynamoDB, S3, and EC2.  Finally, we’ll provide a few common architecture patterns and scalability tips for AWS game backends.

How We Made a Game No Fun
Mike Hines, Developer Evangelist, Amazon
There are lots of suggestions about how to make a game fun.  Best practices are everywhere, but you can't just follow them blindly.  To create a fun game, you have to figure out how best practices integrate into your specific game.  Watch what we did wrong, and what we learned along the way.       

Connecting with Your Customers - Building Successful Mobile Games through the Power of AWS Analytics
Nate Wiger, Principal Gaming Solutions Architect, Amazon
Free to play is now the standard for mobile and social games.  But succeeding in free-to-play is not easy:  You need in-depth data analytics to gain insight into your players so you can monetize your game.  Learn how to leverage new features of AWS services such as Elastic MapReduce, Amazon S3, Kinesis, and Redshift to build an end-to-end analytics pipeline.  Plus, we’ll show you how to easily integrate analytics with other AWS services in your game.

Deploying a Low-Latency Multiplayer Game Globally: Loadout
3:30pm-4:15pm
Nate Wiger, Principal Gaming Solutions Architect, Amazon
This is a deep-dive straight into the guts of running a low-latency multiplayer game, such as a first-person shooter, on a global scale. We dive into architectures that enable you to split apart your back-end APIs from your game servers, and Auto Scale them independently.  See how to run game servers in multiple AWS regions such as China and Frankfurt, and integrate them with your central game stack.  We’ll even demo this in action, using AWS CloudFormation and Chef to deploy Unreal Engine game servers.
 

How Game Developers Reach New Customers with Twitch
4:15pm-5:15pm
Marcus Graham, Director of Community & Education at Twitch
Ernest Le, Director Publisher & Developer Partnerships at Twitch
Twitch is the largest live video platform and community for gamers with more than 100 million visitors per month. We want to connect gamers around the world by allowing them to broadcast, watch, and chat from everywhere they play.  In this session, learn how game developers are creating engaging experiences and reaching new customers via the Twitch platform.

Amazon Fire TV Games on Twitch

Garnett Lee and Tyler Cooper hosted a steam during GDC this year on Twitch. The guys were joined by representatives from 2K games for XCOM: Enemy Within, Tellate for Game of Thrones, Ep. 2, Tripwire for Killing Floor Calamity and ended the night with Hipster Whale and a Crossy Road competition! If you are a gamer interested in seeing first-hand what the current batch of Android games looks like on the big screen be sure check out the stream here

Ready to Submit Your App or Game?

For more information about getting started with the Amazon Appstore, Amazon Fire devices, or how to submit your game check out the following additional resources:

-Dave (@TheDaveDev)

 

April 15, 2015

David Isbitski

The Amazon Appstore now offers over 400,000 apps and games across 236 countries and territories running on Amazon Fire devices, BlackBerry and Android tablets and phones. With new devices like the Amazon Fire TV customers can now enjoy your mobile apps and game through a console-like experience on the big screen. With Amazon Echo, customers can ask for information, music, news, and weather with only their voice and get results or answers instantly.

Recorded live at MoDevCon 2014 during the holiday season, this free video introduced attendees to the unique opportunities for reaching new Amazon customers with their Android apps during the holiday. More apps are downloaded from the Amazon Appstore in the Holiday Shopping season than any other weeks during the year. Thanksgiving week downloads are 50% higher on average and sales during ‘Digital Week’ (the week after Christmas) are even more dramatic. This free video will walk you through everything you need to know to get started selling your apps and games in the Amazon Appstore and offer tips for success. It will cover getting your development environment set up for Amazon devices and exactly what you need to know to get published quickly with minimal code change.

 

For more information about getting started with the Amazon Appstore and Amazon Fire devices, check out the following additional resources:

-Dave (@TheDaveDev)

 

April 14, 2015

Jesse Freeman

Welcome to the final part of our series on learning JavaScript for game developers. At this point you should already have made it through part one (Variables), two (Objects and Functions), three (Conditions) and four (Math). As we wrap up this series we’ll cover loops which allow us to iterate over variables as well as perform repetitive tasks easily in code.

Loops

Loops are critical for any game. All game engines consist of single loop called the game loop which runs each frame updating everything in the game then drawing it to the display. Let’s look over the basic concept of a loop and how it works. There are several types of loops, we will just focus on a for loop:

for (var i=0; i < 100; i++){
    // do stuff
}

This may look confusing but here is the basic concept. We are going to do something 100 times. To start we declare that this will be a for loop. In essence what we are telling JavaScript is that it should loop for as long as 'i', a variable we set to equal zero, is less than 100. We do the test of i in the middle of the for loop statement by checking to see if i is less than 100. The final part of the statement simply says to increment 'i' by 1. You’ll remember back to the math section that you can quickly increase a value by 1 with two plus signs. Now every time this loop runs it will call its contents and then increase i by 1.

This is very useful for getting access to the contents of an array. Let’s look through how to get all of the items the player may have:

for(var i=0; i < player.inventory.length; i++){
    var item = player.inventory[i];
}

Here we are setting up a for loop based on the length of the inventory array. Arrays return the current number of items, in this case it would be 3 and since we are starting our loop at 0 we are able to iterate through all the contents of the array. We can also nest loops which gets a bit more complicated but is useful for displaying the contents of a 2d array:

for(var i=0; i < map.length; i++){
    // get the row’s content
   
var row = map[i];
    for (var j=0; j < row[i].length; j++){
        // get the column’s content
       
var column = map[i][j];
    }
}

If you think back to our 2d array example you will remember that if we access the first index of the map array we get the row and the second index will return the column. You should also pay attention to the fact that I am using two different variable names for each loop. If you used the same variable name it would corrupt the parent loop variable.

Loops can easily grow out of control, especially when you start learning game programming. One thing I want to point out is that loops are process blocking so nothing else can execute until the loop is completed. That means if you use lots of for loops or nested for loops you will start to experience performance issues. Be mindful of your loops and how much you try to execute within the scope of a single frame in your game.

Programming can seem overwhelming but like any other skill you learn, it only gets better with practice. Learning how to code by making a game is a great way to motivate yourself to pick up a new language or just get started from scratch. Hopefully some of these examples help point you in the right direction of how these basic programming concepts can be applied to making games. If you are ready for the next level, check out the related links at the bottom for my post on how to build a simple game HTML5 with Phaser.

Related links

- Jesse Freeman (@jessefreeman)

 

April 09, 2015

Jesse Freeman

Welcome to part four of our five part series on learning JavaScript for game developers. In the previous parts we covered Variables, Objects and Functions as well as Conditionals. In this post, we dig a little deeper into how to perform math equations in JavaScript.

Performing Math Equations

I am just going to go over some simple math concepts here. I actually plan on doing a more in-depth post on math for games at a later point. Let’s cover some basics since everything in programming revolves around math. You can add two values together with a plus sign:

var total = 1 + 1;

Likewise you can subtract them with a minus sign:

var total = 5 – 3;

Multiplication uses an asterisk symbol:

var total = 2 * 1; 

And division uses a forward slash

var total = 4/2;

All of the same math rules you used in school will apply here. There are also some shorthand ways to add values together or increment them. Let’s take addition and subtraction for example:

var total = 0;
total ++;

This will increase total by 1. You can do the same with subtraction:

var total = 2;
total --;

Also you can add two variables together quickly like this:

var valueA = 10;
var valueB = 10;
var valueC = valueA + valueB;

If you want to simplify adding a new value to an existing variable you can do something like this:

var valueA = 10;
valueA += 100;

This will take the current value of valueA and add 100 to it. You can also do the same with subtraction, multiplication and division, simply substitute the plus sign for the correct math operator you want to use.

The last thing I wanted to cover is that addition and multiplication are going to be the fastest math operators you can do. Division is "expensive" meaning it will always be slower than multiplication. Because of this it’s best to use multiplication where possible. We can achieve similar results to what we would get out of division by using fractions. Here is an example of getting half of a value:

var half = 4/2;

We can optimize this by doing the following:

var half = 4 * .5;

This is also incredibly useful for things like displaying a life bar. You may have something like this:

player.life = 5;
player.maxLife = 10;

Here we can get a fraction of the player’s life:

var lifePercent = player.life/player.maxLife;

Now if we have a health bar that we know is 100 pixels wide we can simply set its size to the percent of the player’s life:

var lifeBarWidth = 100;
lifeBar.width = lifeBarWidth * lifePercent;

This will cut the width of the lifeBar in half. I use this a lot in any UI that has a meter or changes size on the fly based on a current and max value. Now that we have a foundation in JavaScript let’s talk about something a little more complex, loops.

Ready to Submit Your App or Game?

- Jesse Freeman (@jessefreeman)

 

 

April 07, 2015

David Isbitski

Amazon is hosting a Developer Day on April 25th at the Cross Campus in Santa Monica, California. Amazon Developer Evangelists will share industry best practices and help mobile developers learn how to grow their app business via the Amazon Appstore. Amazon technology leaders will be on-hand to answer developer questions and lead talks on topics such as building apps and games for Android devices, BlackBerry,  Fire tablets, Fire phone, Amazon Fire TV, and how to build voice controlled experiences for Amazon Echo. Attendees will also learn best practices around how to make fun games and to market your game to influencers and build a fan base.

The format of the workshop will be split between morning lectures and afternoon “App Hours.” The App Hours will allow developers to get 1:1 support to publish and tests their own apps and games to the Amazon Appstore, guidance around building apps and games with Android, Unity and Xamarin, and hands on experience with the Amazon Mobile App SDK, Fire Phone SDK, Fire TV SDK and Amazon Echo SDK code samples. Developers will also be rewarded with Amazon gift cards for successful app submissions to the Amazon Appstore during the App Hours’ time period.

Already have an Android app? Bring your APK for a chance to win cool prizes! Click here to register now!

Agenda

Check-in and Breakfast
9:30am-10:00am

An Overview of the Amazon Devices and Services for Mobile Developers
10:00am-10:45am
David Isbitski, Developer Evangelist, Amazon
We will start the day off with an overview of Amazon's current developer ecosystem. Learn how you can take advantage of Amazon’s Mobile Apps SDK, Amazon's Appstore and the new line of consumer Fire devices like Amazon Fire TV, Fire TV Stick and Fire tablets, as well as monetization services such as in-app purchasing.

Building Spoken Language Apps and Experiences for Amazon Echo
10:45am-11:45am
David Isbitski, Developer Evangelist, Amazon
Echo is a new device from Amazon designed around your voice. It's always on—just ask for information, music, news, weather, and more. Tucked under Echo's light ring is an array of seven microphones. When Echo detects the wake word, it lights up and streams audio to the cloud, where it leverages the power of Amazon Web Services to recognize and respond to your request. With the release of the developer SDK you can now build your own apps and experiences for Amazon Echo. This session will cover everything you need to know starting off with how to use the SDK, how to build your first app, and end with the app submission process.

Lunch
11:45am-12:00pm                       

How We Made a Game No Fun
12:00pm-12:45pm
Peter Heinrich, Developer Evangelist, Amazon
There are lots of suggestions about how to make a game fun.  Best practices are everywhere, but you can't just follow them blindly.  To create a fun game, you have to figure out how best practices integrate into your specific game.  Come see what we did wrong, and what we learned along the way.          

How to Evolve Players into Fans
12:45pm-1:30pm
Peter Heinrich, Developer Evangelist, Amazon
We’ve analyzed the top mobile games to see what best practices make them stand out from the crowd. Several trends emerging now will amplify those best practices, and games will have more opportunity than ever to excel. In the future, the top games will have fully realized fan bases that will drive their user acquisition and engagement engines. That fan base will include players but also content creators, advocates and potential new customers — this will open up a wider range of monetization options. Come see how top mobile games drive more engagement and revenue and learn how to you can do this with your own game.      

Break
1:30pm-1:45pm

App Hours
1:45pm-3:45pm
Get 1:1 support to publish and test apps and games to the Amazon Appstore. Learn how to build apps and games with Android, Unity and Xamarin. Get hands on experience with the Amazon Mobile App SDK, Fire Phone SDK, Fire TV SDK and Amazon Echo SDK code samples.

Raffle and Wrap-Up
3:45pm-4pm


Seating is limited so be sure to register for the event to reserve your spot. Hope to see you there!

-Dave (@TheDaveDev)

 

April 03, 2015

Jesse Freeman

Welcome to part three of our five part series on learning JavaScript for game developers. In part one we talked about Variables and in part two we covered Objects and Functions. In this part we’ll walk through how conditionals work in JavaScript to add more complex logic into your code.

Conditionals

ames are made up of states and we are constantly trying to determine what happens based on that state. Is the game running? Is the player alive? Does the player have a weapon? If the player has a weapon can they can shoot? In order to test these states we will need to use conditionals. There are three main types of conditionals I’ll go over here. The most basic is an if/else statement:

if(player.isAlive == true){
    // do something
}

Here we are testing to see if the player is alive. By using the double equal sign with are making sure the player’s isAlive property value is equal to true. If the player is alive we can run some code. But what happens if the player is not alive. For this we can make use of an else statement.

if(player.isAlive == true){
    // do something
}else{
    // do something else
}

Here you can see we are still testing if the player is alive. Now we can execute different code such as end the game if the player is not alive. Likewise you can add as many if statements as you like this:

f(player.isAlive == true){
    // do something
}else if(player.isAlive == false{
    // do something else
}else{
    // do nothing 
}

Another interesting way to take advantage of conditionals is by using something called a switch statement. It’s similar to an if/then statement but allows you to test a variety of values without the need for adding operators such as equals, less than, etc. Here is how you create a simple switch statement:

switch(letter){
    case "g":
        //do something
       
Break:
            default:
        // do something
       
Break;
}

As you can see the switch statement is designed to test a single value against a case. If we were to pass in a string "g" it would pass the first case. We always add a break at the end of a case to keep other cases from executing. Finally we can use a default case to run something if no value is matched. Switches are very common in games and a great example would be getting the value of a letter in a game of scrabble:

getLetterValue(letter) {
    switch (letter) {
        case "g": case "d":
        return 2;
        break;
        case "m": case "b": case "c": case "p":
        return 3;
        break;
        case "y": case "f": case "v": case "w": case "h":
        return 4;
        break;
        case "k":
            return 5;
            break;
        case "j": case "x":
        return 8;
        break;
        case "q": case "z":
        return 10;
        break;
        default:
            return 1;
            break;
    }
}

Here you can see that I am assigning values to different letters. The most common value is always going to be 1 so that becomes my default return value. From there I set up cases for each letter going in order of value. You can add additional cases to a single test as you can see from each one of these score tests I wrote.

There is one additional conditional I want to go over quickly called a ternary operator. It’s similar to an if/then statement but all on one line. Here is an example:

var playerState = (player.isAlive == true) ? "Alive" : "Dead";

In this example we simply test to see if the player’s isAlive property is set to true. We do this test on the left hand side of the question mark. If the statement is true than playerState’s value will be set to "Alive" which is on the left hand side of the colon. If the value was false, the statement would return "Dead" which is on the right hand side of the colon. Here is a quick cheat sheet for how to write ternary operators:

condition ? value if true : value if false;

These are very useful when you don’t need to write out full if statements or are trying to clean up values into strings and need to do it inline of a variable.

Ready to Submit Your App or Game?

- Jesse Freeman (@jessefreeman)

 

 

March 18, 2015

Jesse Freeman

Welcome to part two of our five part series on learning JavaScript for game developers. In part one we talked about Variables. In this part we’ll cover Objects and Functions. Previously we simply stored variables in the global scope. This is not the best way to do that. In order to build more complex data structures we rely on something called Objects.

Objects

Think of an Object as a container that can hold other Variables, Arrays and even block of code called Functions. Here is an example of how to create an Object:

var player = {};

This is similar to how we created an Array but unlike an Array, values we attach to Objects are not ordered. Here is an example of how we would put a name variable on the player:

player.name = "Jesse Freeman";

When we attach a variable to an object it is called a property of that object. To access its value we simply call it by name like so:

player.name;

This would return "Jesse Freeman". We can also attach Arrays to Objects just like we do variables:

player.inventory = ["item0", "item1", "item2"];

To get the value of something from the player object’s inventory simply access it just like you would a normal array:

player.inventory[1];

This would return "item 1" from the inventory array. Objects are incredibly powerful in JavaScript and should be used to store and organize data such as player info, game settings, level details and even game logic. As you continue to build out a game you will eventually need a place to store instructions of code. For this we use something called functions.

Functions

Functions allow us to create containers of reusable instructions. It also allows us to control when a block of code will get executed. Take the following example:

var firstName = "Jesse";
var lastName = "Freeman";
var fullName = firstName + " " + lastName;

Believe it or not this is a common process where you would want to combine two variables together such as a first and last name. If you run this code in JavaScript it would execute immediately. Also, we would have no way to rerun it. Functions allow us to control when and how this action would take place. Here is the basic template for writing a function:

function getFullName(){
    //code goes here
}

Just like we declare a variable with var we denote a function with the function identifier. Next is the name of the function and then the block of code that will make up the function is contained in the curly brackets. Here is an example of the above function but with some logic inside of it:

function getFullName(){
    return firstName + " " + lastName;
}

Here you will see that we moved the code that combines the first and last name into the function. We are using a new statement called return which will give us back a value when you call the function. In order to execute this you can call the function by name:

getFullName();

Even better, we can assign the value we get back to a variable:

var fullName = getFullName();

But this will only get us so far. Since the function has a scope of its own, meaning it doesn’t have access to anything outside of the curly brackets, it has no way of getting access to the first and last name variables. Luckily you can pass these into the function via parameters. It looks something like this:

function getFullName(firstName, lastName){
    return firstName + " " + lastName;
}

Now when we call the function we can pass in our first and last name and the function will return the full name back.

var fullName = getFullName("Jesse", "Freeman");

Functions can have any number of arguments and you can pass in Strings, Numbers, Booleans, Arrays, Objects and even references to other functions. As you learn more about coding you will make extensive use out of functions and eventually you will learn how to attach them to Objects so you can reuse them throughout your games. Next, we’ll talk about how to build conditionals in JavaScript to help you build out logic blocks in you own games.

Ready to Submit Your App or Game?

- Jesse Freeman (@jessefreeman)

 

Want the latest?

appstore topics

Recent Posts

Archive