Dusk Engine

I would love to see something done with Dusk if anyone has any examples.  Been wanting to get into tile game.

Well I’m currently working on a fast paced sidescroller and honestly I think that Dusk will be just fine. I’m not worried about speed.

I may post some pictures or footage soon of how the game looks, but I need to solve some problems with the map first.

hi there,

i’m trying to figure out what these lines mean, if you could break it down for me it would be much appreciated…

-- Position player and star player.x, player.y = map.tilesToPixels(map.playerLocation.x + 0.5, map.playerLocation.y + 0.5) finish.x, finish.y = map.tilesToPixels(map.finishLocation.x + 0.5, map.finishLocation.y + 0.5)

i tried looking in your Dusk Docs but I think you’re still working on completing it right?

I’m wondering how you positioned/determined where to place the objects… this is in your bob.lua file.

I tried opening your Tiled level files (mapdata/levels/…) but i only saw you drew in the level itself in your single layer called “tiles” but no object layer/player/stars

thanks

I was having an issue with objects and different screen sizes. Here you can the iphone 4 size things are correct. In the ipad image, some of the objects are positioned weird. Not sure what’s going on here, could be me.  The turtle (purple) and the spring (red) should sit on the ground as in the first picture. 

Screen-Shot-2014-01-05-at-11.56.51-PM.pn Screen-Shot-2014-01-05-at-11.56.30-PM.pn

Just wanna give a shoutout to Caleb the Clever guy (:
Get ready for my questions soon brah, coz im planning to make a platformer game!  this better help! :P   :))

How did you make physics objects smaller than the actual image and how did you make your bottom one complete physics object like that? Also how did you create physics objects like the circle with no image there, I only know how to make a physics object based off an image. Sorry for noob questions

0i7DQ7t.png

I’m having troubles with the collision where my guy will get stuck on the 32x32 squares if he walks on a wall. I want one complete wall and not 32x32 walls that are all lined up. Also in Tiled there are these weird gaps when i bring it up in my app. I posted a picture to show the example, and I don’t want them to be there because they cause problems.

Also I am using the Physics Editor for that one wall that I said “yes” as what I want (which is making the image false so you cant see it, but Physics Editor is causing me problems where I would rather do it through corona or tiled physics. Thanks for the help.

 

The platforms, ground and wall objects are drawn as objects on an object layer. The spring thing, and the character at the bottom were created as tile/picture objects on an object layer. 

Yes, ty very much! That solves a lot of problems!

Edit: That answer ended up solving my other question too, I’m just using objects now instead of using individual tiles every time. The object layer works perfectly and doesn’t cause any collision problems anymore (I just create the objects for every wall on the tiled map), the new problem is now the screen flickers like crazy on the sides of the app when I move the player. If I delete the object layer the flickers go away too. They are like giant black small rectangles/lines that last 0.5ms, would not make the game fun lol. Any way to keep the object layer and get rid of flickers?

Also I noticed the examples from github dusk engine the screen flickers like mad too…I think this would be a big problem for a game.

[quote name=“lvl9hero” post=“224039” timestamp=“1388992294”]hi there,   i’m trying to figure out what these lines mean, if you could break it down for me it would be much appreciated…  

-- Position player and star player.x, player.y = map.tilesToPixels(map.playerLocation.x + 0.5, map.playerLocation.y + 0.5) finish.x, finish.y = map.tilesToPixels(map.finishLocation.x + 0.5, map.finishLocation.y + 0.5)

i tried looking in your Dusk Docs but I think you’re still working on completing it right? I’m wondering how you positioned/determined where to place the objects… this is in your bob.lua file. I tried opening your Tiled level files (mapdata/levels/…) but i only saw you drew in the level itself in your single layer called “tiles” but no object layer/player/stars   thanks[/quote] could anyone help with this question? sorry I’m totally new to any kind of programming but I’m really trying to learn thanks.

@lvl9hero:
Map -> Map Properties… holds the values the main map object has. Properties put there will show up in the main map object.
 
@soggybag:
I’ll look into this. At the moment, try implementing a dynamic config as shown in “The Ultimate ‘config.lua’” or changing your scale type.
 
@Azmar:

For the flicker issue, have you tried the screen texture filter settings:
[lua]
display.setDefault(“minTextureFilter”, “nearest”)
display.setDefault(“magTextureFilter”, “nearest”)
[/lua]
Otherwise, you’ll have to try extruding your tilesets. If the problem is more than just flickering lines between tiles, please file an issue with a test case in it.

As for your physics body issue, the tiles on the left (after the PE wall) are like that because they’re just that - tiles. Each tile is given its own physics body.

  • C

Hmm…I have a pretty wierd problem here.

My character object gets stuck in vertical tiles AKA walls, if it keeps moving towards them.

It keeps moving up and down a little.

I don’t know why the object can even overlap  tiles in the first place. I’m guessing it has something to do with the body type, but I don’t know how exactly I could solve this problem.

The character shouldn’t be able to move slightly over tiles.

If the character wouldn’t overlap into tiles, he wouldn’t get stuck.

Any ideas?

Getting stuck on walls going vertical was exactly the same problem I was having. It’s because you have those 32x32 blocks all attached making a wall and he will get stuck on each 32x32 block. After a lot of testing it seems to happen most the time going on any right wall lol. I think you are setting the properties to the walls in the tiled layers, but should be on object layer. Just make one complete object around that wall in the object layer that has the same properties as those walls so it will create a giant wall and not a 32x32 block attached with more blocks.

On a side note after you change everything to the object layer, let me know if you get any weird black flicker lines anywhere on your app, that happen a lot.

Hmmm…in the layer properties I’ve only added physics:enabled. And added static body types to every seperate tile.

Make one complete object around that wall…you mean just display a rectagle or something where the wall tiles are?

Or is it possible to somehow group tiles into one object?

@tilen.curen:
You can try what Azmar said (though you’ll need to be careful; objects are not culled like tiles are). I think what he means is, instead of making each tile physical, make them just tiles and draw objects to work as the walls. Then, you won’t “stuck” on the boundary between tiles (if that’s what’s happening). If your player is actually moving into the tiles, it’s probably happening (if you’re setting the velocity each frame) because the collision isn’t stopping the player. In that case, I’d set up a “collided” flag for walls and stop setting the velocity if the player is hitting a wall.

I’m going to go a bit “underwater” for a while, as I’ve got a deadline on a personal project I’ve got to finish. I’ll be a bit less active for a while; though I won’t be completely silent, I won’t be available to help quite as much as usual.

  • C

@Caleb P:
The flicker problem is not the flicker inbetween tiles, that is a problem too and the  display.setDefault(“minTextureFilter”, “nearest”)display.setDefault(“magTextureFilter”, “nearest”) does not fix it enough. There is a new flicker with giant black lines on edges of screen that only starts when you create an object layer which makes no sense. I would like to send you a file report but its a pain to recreate it without sending my entire project… because the camera/movement/tiled file/engine/images is needed to recreate it. If I delete all object layers it goes away, but obviously I need my object layers. Oddly enough after hours of trying to fix it, if I have the object layer as my first and bottom layer it will still do its physics job, won’t be seen by the program… but the flicker problem is completely removed. I’ve remade multiple maps and fiddled with my code a lot of different ways to figure out where the problem was, I’m pretty sure this is a bug?

Someone replace the Lime forum with this in the Tools & Services forum group!!!

Great, just dowloaded this will try and make something tonight. Thanks!

Everything looks amazing with the new engine! Only my second week into corona and lua, after testing your old engine I am trying to bring everything over from my old game with the new engine. When I load up my map and insert it into the gui, only the bottom layer stays on the map but any multiple layers in the .json file all fall off the screen right when I start the program. I tried making them static in the tiled program (the other layers), or insert each layer into the back.gui but those did not work.

Edit: I tried doing gravityScale = 0 to the layers and that did not work, adding objects to the screen work fine doing that method just not with multiple layers in Tiled.

Are you sure you’re using the right layer properties?

Here’s the correct approach (where the first is what you enter into the “name” field, and the second is the “value” field).

For an object layer:

[lua]

objects:bodyType          =          static

[/lua]

For a tile layer:

[lua]

tiles:bodyType          =          static

[/lua]

  • Caleb