Pirate Battle


Hey everyone!

First of all, want to say very big thanks to developers and team of Defold! My name is Nikita Borisov, I’m a programmer of TinyDobbins team, (before we called NSBrotherhood). and made such flash games as Lazerman, Tesla Defense, WizardWalls
the current project also is gunfight.io client side made on PhaserJS, the server side on NodeJS+Colyseus

a couple months ago we decided that it’s time to make mobile games.
Before I’ve tried the Unity, and one thing that I want to say, when I trying to do something in Unity … wanna kill everyone, very hate this tools :smiley: terrible experience.
but with Defold I wanna love everyone :cat: Defold seems to be the engine i was looking for.

now I working on making the port of old game made by Martijn Kunst.
we made the re-make on html5 (PhaserJS). How the game is looks, you can see video of gameplay that what I want to see as result in Defold.

after a couple weeks of learning of tutorials and docs of API with the help of @AGulev and @Dragosha and of course with the help of God :smiley: I made first step of porting:

the next steps:

  • add camera
  • add parallax of backround
  • add effects
  • aiming, showing the power of shot and first steps of the path of balls

the main issue that I faced right now is opportinity to flip the gameobject with spine model like
hero.scale.x = -1 in flash for example :smiley:
related topic of this issue: here and here
the temporary solution is to flip in the editor, but I add all objects dynamically.
I also tried:
go.set_rotation(vmath.quat_rotation_y(math.rad(180))) and go.set_rotation(vmath.quat_rotation_z(math.rad(180))) it just flip “top down”

thank you Defold!



Yay! Welcome to the forum and congrats on the progress you’re making on the game!

I was expecting this to work.



I just tried now to remove the collision object, and that code works.
so looks like game object with physics and spine works weird together.

1 Like


Ah, yes, there’s a bug with collision shapes becoming upside down when rotated (DEF-1117).

1 Like


@Mathias_Westerdahl has promised to take a look at DEF-1117, but no guarantees that we’ll release a fix in the next release.

1 Like


@britzl ok! for now I see the alternative in using 2 gameObjects: one for SpineModel, other for CollisionObject.

1 Like




made all items from list above and for characters I use collection with spine component and gameobject with collision object. Then in update of the first:

go.set_position(go.get_position(self.linkBody), PATH_SPINE)

Very big thanks @ross.grams for the help in development of Predictive trajectory line of GameObject

what is next:

  • add complex objects as a large pirate ship and stones. (thinking how to generate multiple static collision object components) using Defold Polygon Editor and PhysicsEditor
  • screen fade effects: black fade in/out when changing game screens and white flash effect after a grenade explosion
  • test on andoid! I’m getting excited to check out the game on mobiles. but first need to write scale manager. any tips with it are welcome! :slight_smile:


Lovely aesthetics and animations, @BunBunBun! Looking forward to playing it :slight_smile:



What is the scale manager supposed to do? There are camera extensions in out Asset Portal that will help you set up your screen in a way that works on many different screen resolutions and aspect ratios.



now i’m using your defold-orthographic camera. Is the orthographic camera in Rendercam can do same things? I see follow, shake, but is there deadzone for camera also?

1 Like


Yes, I believe the feature set is very similar. I think Rendercam has a recoil() function as well, but that could easily be added to defold-orthographic as well.

1 Like


as I understand recoil() function need for shake effect. right? :slight_smile:
I’m looking for camera.deadzone and camera.bounds in Rendercam or scalemodes in defold-orthographic…



The recoil function is kind of like a camera shake, only just in one direction. Deadzone and Bounds features are in-progress (they work fine, just not for all the camera types that Rendercam supports) thanks to @selimanac. Use https://github.com/rgrams/rendercam/archive/dev.zip as your dependency link if you want to try them out.

I only have one android device for testing, so I honestly don’t know how well Rendercam’s scale modes work on devices with different resolutions, but I will try to fix things if they don’t work as expected. (I’ve tested them pretty thoroughly with variable window sizes on desktop.)



nice! okay I will re-write the camera in my game and will test and inform a result.

1 Like


How does the scale modes work in Rendercam? It sounds like the same as one of the predefined projectors of defold-orthographic.



Rendercam has four scale modes:

  • Expand View: Keeps the same pixel scale, just shows more or less area depending on the window resolution
  • Fixed Area: Scales to render the same area, regardless of window size and proportion
  • Fixed Width: Always renders the same width, expands/contracts height to fit window
  • Fixed Height: Always renders the same height, expands/contracts width to fit window

On the asset library page I have some demo images for each mode (though the difference can be subtle).



Ah, I see. So that’s equivalent to this config value for my camera: https://github.com/britzl/defold-orthographic/blob/master/README.md#projection-hash

Those are the predefined ones but you can also provide your own function to calculate the projection matrix: https://github.com/britzl/defold-orthographic/blob/master/README.md#cameraadd_projectorprojector_id-projector_fn

I probably need to simplify the docs and provide nice looking pictures just like you did…



@britzl yes! projection FIXED, looks like the Fixed_Height in Rendercam. that’s I need.
but it would be useful to add main projections such as Fixed Width for example.

@ross.grams I’ve tested today your camera. all works fine. only one issue with the order of arguments:
in docs:

rendercam.set_bounds(left, right, top, bottom, [cam_id])

but in the rendercam.lua:

M.set_bounds(left, top, right, bottom, cam_id)

same with set_follow_deadzone function

Thank you all guys!

1 Like


whooouuups . . . :anguished: good thing that’s still in the dev branch. I will fix it first thing tomorrow!!!

OK, I fixed it so it’s consistently: left, right, top, bottom. I made a separate branch, I suggest you switch your dependency link to this: https://github.com/rgrams/rendercam/archive/2.0Beta.zip - since I may make more breaking changes on the ‘dev’ branch. Thanks for testing!



new progress, all gameplay features and levels are ready.

also added GUI, paused state, finish/win popup, music, voices. sfx in progress

in to-do-list:

  • save system, haven’t checked DefSave yet
  • add comics
  • level menu
  • shop menu
  • congrats screen
  • balance the damage system
  • test on iOS. is it possible to do it without developer account?