onion's Forum Posts

  • I've been making a game for android, and noticed how slow it is. So I've gone right back to basics and created just a small test project just to see what affects the framerate the most.

    I used some pixel art for a sprite and added the car movement behaviour, with some buttons to move it around etc. Here's a screenshot:

    <img src="http://i.imgur.com/AhYxlUX.jpg" border="0">

    Download my test game capx

    On the desktop I get regular framerates of 50-60 fps, but when exporting to Android through phonegap I'm punished with a really low framerate of 15-30 fps.

    Maybe the framerate counter is broken? When I leave the android app idle the framerate does go up to 179 though, which is MENTAL. But I assume incorrect?

    I think I'm doing everything that one should do to optimise for mobile, for example:

    Aspect ratio 16:9

    Window size: 400,225 (I assume smaller is better - right?)

    Pixel rounding: on

    Scale outer

    Sampling: point

    Sprites with images no larger than 128px (although if you download the project file you'll notice a jpeg in there for testing. Including/removing this doesn't have much impact on the fps).

    Any other ideas for what I should be doing to optimise for mobile?

  • I've imported a spritesheet of tiles to use as background objects. But now I've made changes in Photoshop, and I want to re-import them again - is there an easy way to do this, or do I have to do it manually?

  • Actually I've got a question related to this. I'm using tiles of 32x32 in my layout. Which means quite a lot of tiles - I haven't counted them but there'll be hundreds. Some of the free assets I'm using have object like building split up into many separate tiles which I have to place one by one. Is this more or less efficient that grouping the tiles together in Photoshop and them importing as one object?

  • Cheers guys :-)

  • I've just been importing some spritesheets into C2 from another project, and I've noticed that C2 is separating out all the spritesheets into separate PNG files. It started to make me wonder if this was more or less efficient?

    Obviously the sprites I'm using were bundled all onto one single spritesheet in the first place must have been for efficiency, so it seems counterproductive for C2 to then split them all up again.

    I've no criticisms of how C2 does it. Purely wondering, that's all!

  • I've had this problem too, I had to line the sprites up in photoshop. Is there any way you can use DAME (I've not actually heard of it!) to export without the margins?

  • I've been senty here by I didn't realise saving an array to webstorage would be so simple :-)

  • OMG that's a much simpler solution - thanks so much ramones, I'm in your debt!

    I've just tried this on my project and it works perfectly :-)

  • I'm making a simple platformer with a level select screen (think angry birds etc - finishing one level will unlock the next. I followed this excellent tutorial: https://www.scirra.com/tutorials/311/level-select).

    So when the user closes the browser, I want the level progress to be saved. I've seen tutorials about web storage in C2, and have implemented this for a single variable. But I actually want to save an array, because I want to save whether the user got 1/2/3 stars on each level.

    So I looked into saving arrays into web storage, and found this example: http://www.jargogle.co.uk/test/ArraySavingLoading/ (thread here) ...which seems a bit complicated.

    I also discovered the save/load feature in C2. Should I be using that instead? Or is it overkill for my simple game?

    Are there any benefits & differences between using webstorage vs save/load?

  • Woah that's so simple, I would never have thought of using a blend mode for this. Thanks Sqiddster!

  • Hi guys, I'm struggling to think of how to get this to work. I have a top-down space shooter game, and I want the ship to cast a shadow when over some surfaces - but not all.

    The look I want is when the ship is moving over an asteroid, there should be a shadow, but when out in open space the shadow should be gone.

    Any ideas? Perhaps I could do this with some sort of masking?

  • You're 1% towards making a Worms game (that was a weapon right? : P ). Collab with the guy who made destructible terrain! xD

    I second this. DO IT! :-D

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • If your game is scifi and you need an interesting story or concept, my brother has a blog at scifiideas.com which often posts great ideas and concepts.

  • Sorry for dredging up an old thread, but can someone link me to a more modern example of this?

  • Thanks very much C-7, it's great that you've shared your code! Your solution is sound, but have a niggling worry about the amount of duplication you've got if you have similar code for each NPC. Although it's not much of a problem as long as you don't need to change it.

    theubie I'm glad you've told me about this solution, it's what I've had in my head actually. I'm very familiar with mySQL, so this wouldn't be a problem. It essentially makes C2 the frontend and store the logic elsewhere. A bit like a webpage actually.

    As a webdeveloper, this makes sense to me!