Stratosphere: Gravity Rush


#1

It’s been a while since my last Defold release. Here is a game that was originally built natively for iOS and that I have now ported to Android via Defold. The idea was to use the accelerometer to re-create the feeling of bouncing a ball on a ping pong racket.

Google Play Store


#2

Welcome back @Karl_Hornell!


#3

on nice! Can you please compare the performance of the native vs Defold? Memory-wize and battery/cpu-wise?

Also perhaps a few thoughts about development tools and experience?


#4

On an iPhone 6, running at 60 fps, the native version uses about 25% CPU when playing a typical level, whereas the Defold version uses about 42%. But the porting process was relatively quick and dirty. If I optimized the lua code and game object management for speed, I might be able to shave off a few percentage points.

The reason why I built a native iOS version first was that I needed to mask sprite images against arbitrary shapes. The shadow is only supposed to be visible on the tiles, and they aren’t perfectly square on all levels. Sometimes chunks are missing. SpriteKit for iOS has support for that. (I assume it’s theoretically possible to achieve something similar with Defold, but that would require an insight into the Dark Arts of custom renderers that you can’t get from reading the documentation on this site.)

When I ported the game I decided to skip the pixel-perfect masking and just use plain rectangular shapes. However, as far as I could determine, this feature is only available for GUI components, so the ball and shadow had to be implemented as GUI nodes.

The Defold Editor feels a little smoother to work with than Xcode for most things except testing on actual hardware. A little too often it loses connection to the device, gets stuck or won’t install, but that might be because I’m still using version 1.2.


#5

You’re one of the last people on this planet using the Editor 1 =]

Thanks for your thoughts. As an immediate take away, I am prioritising a video-tutorial about the render script for the next issue of Defold video blogs to help people master the Dark Arts.