Laurent's Recent Forum Activity

  • Laurent Check this out:

    https://www.dropbox.com/s/u59b4ogf0vwo4lm/BitmapToTilemap.c3p?dl=0

    Thanks dop2000 !

    That's most impressive, I see the logic behind.

    Unfortunately, it's still seems to work erraticly. Most of the time, the design is perfectly transcribes, but it stills displays two rows vertically when the bitmap has only one.

    I never thought it would be so difficult to sort out. I guess I will rely on some sort of array.

    My goal was to create solid tilemaps to display invisible above a map drawing in order to code obstacles for pathfinding.

  • You can use "pick by point". Its a bit weird as far as setting up goes but it works.

    I'll be happy to see this in action

  • > construct.net/en/forum/construct-2/how-do-i-18/simple-scorched-earth-worms-129595/page-2

    Unfortunately that method doesn't work in C3

    Damn ! We're doomed...

  • Hello

    I try to create an engine that will allow me to build tilemaps from a bitmap. I think it will be an easy and memory friendly system to store tilemaps.

    Thanks to calminthenight, I managed to adapt this little engine that works this way :

    - create a bitmap on transparent background where every pixel represents a tile in the tilemap

    - paste bitmap in canvas object, take a snapshot

    - scan the snapshot line after line ans check certain color (in the current example, I scan only for red pixels, i.e. where DrawingCanvas.SnapshotRedAt = 62)

    - create related tile at same coordinate in the tilemap

    The system logic is ok but it seems there is a viewport scale issue, i.e. when my original bitmap is 10x10 pixels, its size changes according to viewport scale when layout is displayed. So the created snapshot could be bigger, a 1x1 pixel could become a 2x2 pixel and the tilemap is not correctly created. Here is the original file : https://www.dropbox.com/s/p4my3kk4tcihbk2/MapFromPixelSprite.c3p?dl=0

    Following are two screencap showing how thinks show on screen at different viewport sizes and the image of the original sprite.

    Tagged:

  • You do not have permission to view this post

  • You do not have permission to view this post

  • You do not have permission to view this post

  • You do not have permission to view this post

  • You do not have permission to view this post

  • There ya go : dropbox.com/s/g6vk2edgy81lmrw/spritecoordinatearray_edited.c3p

    edit : ok I see you want to spawn the sprites instead of flash, well use my logic and instead use create sprite action and also an action of set ID to the tokenat value displayed in the condition at line 9

    Thank you very much !! I managed to adapt your tip to create sprites.

    Here's the file, if it can be useful to anyone : https://www.dropbox.com/s/oaq41k1xn2fuw0m/MapFromJson.c3p?dl=0

  • My approach would be to have the next instance variable with all the instance IDs so it could be "1,2,3" then you could use the tokenat expression to grab individual numbers, and use a loop to run through each picked instance. If you can't work it out maybe I can add to the project file if I have time.

    Thank you ! Indeed, it's beyond my skills. Actually, this loop approach would be to allow to spawn more than one instance when a sprite is clicked. for example, when sprite with SpriteID = 1 is clicked, create instances with SpriteID 2 and 3.

    I updated the file here : https://www.dropbox.com/s/3b7b6q09kuwkybx/SpriteFromArray_Test.c3p?dl=0

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You could either pick all sprites again using system pick all and then use your pick condition (within the same sub event) or you could use a function and pass the values through as parameters to pick the correct sprite.

    Thank you ! I managed to do it following your first suggestion but I'm very curious to see how you would code the second one.

    Any idea on how to code link to multi instances ?

Laurent's avatar

Laurent

Early Adopter

Member since 18 Jan, 2012

Twitter
Laurent has 1 followers

Trophy Case

  • 12-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

17/44
How to earn trophies