nimos100's Recent Forum Activity

  • You just add both condition to the event?

    If A = True

    If B = True

    ---> Do C

  • This is by design: because the fade behavior is active on startup, it retrieves the opacity to fade to when it is created, before 'On start of layout' triggers. After that it controls the object opacity, so your 'Set opacity' action is overridden.

    The workaround ought to be to have the fade behavior inactive on start, and use the 'Start fade' action after the 'Set opacity' action. However I noticed this did not work, but fixed that for the next build.

    Cheers Ashley much appreciated

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • >

    > Your approach:

    > Object collide with tile on tilemap that have a certain ID

    > Find coordinate

    >

    >

    >

    Why do I have to find coordinate?

    my approach is :

    Object collide with tile that have a certain ID on tilemap

    and that's all. I just want to interacte with tile that have a certain ID on tilemap if this tile is collided by an object, whatever coodrdinate.

    Yeah guess it could be done, if C2 made all the checks. So you are actually requesting a feature, more than asking for how to do it I guess?

  • When I talk about improvement, I mean that all you say would be handled by C2 in background process.

    The actual way to specify tile by ID is really useful in many case but also tedious for non programmer users.

    So, the "improvement" that I talking about is only ergonomics :

    if the user add condition > on collision with another object > tileMap (indicate tile ID in text field below)

    C2 should manage to write all the things that you explained to me in the code (comparison tile at, for...loop, etc).

    I'm glad to learn what you explain to me, but I think that kind of improvement should be coherent with the principle of "no coding" developpement software.

    But what you want to do is like it is, you just want to use Tile ID first instead of coordinate. But regardless of which approach you use, you are going to have to check the tile coordinate anyway.

    Your approach:

    Object collide with tile on tilemap that have a certain ID

    Find coordinate

    C2 approach:

    Check if object is colliding with a given coordinate

    Check if its a certain ID

    But its not really coding as I see it, its math using a very basic coordinate system.

  • Thank you very much for this explaination.

    So, if I understand well, I have to specify coordination for all tiles wich have same ID?

    If I have 30 tiles "ID:3", I must create 30 conditions for each tiles if I want add an action "on collision/ is overlapping"?

    It's sounds crazy.....

    No, the coordinates and IDs are automatically created by C2. For the coordinates as shown in image (4) these are the same no matter what tilemap you use. So top left corner will always be (0,0) regardless of your tiles being 32x32 px or 128x128px.

    The tilemap object it self use its own coordinate system. Might be easier to understand if you try to make a tilemap and set the tile width and height to 1 px. Then it works the same way as the normal C2 coordinate system (X,Y) that you use whenever you make an object and move it around, all objects then have a X,Y coordinate that tells you where on the layout they are placed.

    Its the same for the tilemap except it also have it owns coordinate system that it uses for placing tile correct in the tilemap.

    So you don't specify a coordinate for each tile, you check a certain coordinate to see if it contain a certain tile.

    If you have 30 tiles with a tile that have ID:3 you use a "For..loop" to go through each tile and check whether a tile have an ID:3 tile at that position.

  • To test on iPad I download from a Dropbox link and select "add to home screen" - it's un-playable still and with chrome on the PC achieving a mere 40fps after export -I am now concerned.

    I have not yet decided to pay Apple the annual fee, so cannot export with Cordova or Intel XDK. Is that correct?

    Is there no way of just exporting as an iPad app (for Dev testing only) which could then be dumped into iTunes and synced to the iPad? I tried all the older tutorials on here and set show depreciated exporters but haven't found anything that may help.

    Should also mention I'm still running C2 Beta 210, pretty desperate for the stable release but I started out that project using it.

    Unfortunately, I have to admit that my knowledge regarding performance on IPads and Phones in C2 is not my strongest point, I don't make anything for those, so only know what others are reporting about it, and from what I understand you are not the first one to experience performance issues with those devices.

    But I really don't know what you can do to fix it, but hopefully someone with mobile developing experience see the post and can give you some tips.

    But if you loose 20 fps in Chrome after adding the menu, something could indicate that you are doing something wrong in that part. Especially if you say that its very simple. The screenshots you posted was that the whole menu?

  • Hmm nothing from the screenshots seems to cause any problems from what I can see. Do you get the same performance in other browsers? And are you using any effects?

    Also have you tried to disable the menu events one at the time where possible to see if you can pin point where it happens?

  • So I'm struggling with this. I want an object to move between 3 different points on the X axis, like this: * * *

    The object starts in the middle, then if I press the left arrow key it will snap to the left point. If i press the right arrow key it will snap to the middle and if i press right again it will snap to the right and vice versa. It's a simple mechanic but I'm struggling to make this work properly. I tried using the MoveTo plugin by REX and it works between 2 points but I can't for the life of me, figure out how to make it work seamlessly between 3 points. I have no idea what the best pracises are for these kinds of mechanics.. Any help is greatly appreciated!

    There are lots of ways to do this, but the easiest might be to simply make a variable in your object called "Position" or something. This variable then hold the current position of the object. Like so:

    (X = 1) (X = 2) (X = 3)

    Then in your object you simply check what value the position is, when you press a key and add or subtract based on the key pressed.

    So if the object starts in the middle the "Position" variable is 2. Pressing Left key you subtract 1 from Position and if its the Right key you add 1.

    Then you can make 1 small sprite object (Named location) and give it an index variable and make 3 instances of it, each with a different index that relate to the position, so it would be 1 for the left one, 2 for the middle and 3 for the right one, then you can use those to easily control the position of the object, and so you can move it around later if you need to without having to change any code.

    And then you add something like this:

    Function Update_Object_position
    Pick Location.Index = Object.Position
    Set Object.X/Y to Location.X/Y
    [/code:1h4ielcw]
    
    Then you ofc just have to add the keys to add and subtract from object.position and make sure that position cant go below 1 or above 3, and call the function each time one of the keys are pressed.
  • Try to post some screenshot of the menu code and the debugger especially the system tab and the profile window. Don't think anyone can help you unless they have at least something to relate to.

  • Thank you for help!

    It's actually too complicated for picking tile by ID for a non programmer like me.

    I guess one day there will be simple condition like :

    add new condition > on collision with another object > tileMap (indicate tile ID in text field below)... and that's it!

    Until this kind of improvement, I will use tile map only for decoration.

    The tilemap is not really that hard to use once you understand the basics of how it is constructed.

    Image (1): Just using the basic tilemap in C2. You can look at a tilemap as being just a collection of images combined into 1 image. The reason to use a tilemap is because you can reuse a lot of graphic and reduce the performance hit from using a lot of sprites. So instead of adding lots of objects you simply add a tilemap and reuse the graphic over and over. There are some other benefits as well, but to keep it simple ill just focus on the basics.

    Image (2): Shows a single tile in the tilemap, which current size is set to 32 x 32 px, this is equal to adding a sprite and setting its width and height to 32px. But since the tilemap split the image into tiles, you need to tell C2 what size these tiles are, so it knows how many tiles the tilemap should contain.

    Image (3): Once the size of each tile have been set, C2 split the image into tiles and give each of them an ID, so its easy for you to see which graphic belongs to what tile. And it makes it possible for C2 to work with the tiles. This ID identify what image is related to a given tile. And can be compared to you making 2 sprites and calling one of them "Image_1" and the other "Image_2".

    Image (4): Guess this might be what confuse you a bit. But the tilemap object can be compared to adding a lot of sprites next to each other. But instead of you having to add all of them, you just add the tilemap object and C2 will then split it up for you in the tile sizes that you set in Image (2). The tilemap object, that being the one in the C2 viewport will be split into areas that match the size of the tile width and height.

    So a tilemap that is 320x320 px and have a tile width and height of 32 x 32 px will have 10 tiles in X and 10 tiles in Y. And each of these tiles will have an index so C2 know which tile is which. Looking at Image (4) you can see the tile coordinates, which always starts at 0,0 in the top left tile. This coordinate have nothing to do with the X,Y value in the normal coordinate system that C2 uses. So you can place the tilemap at X: 500 and Y: 500 in the viewport, but the top left tile in the tilemap will always be (0,0).

    Image (5): Shows a tile placed on the tilemap, this tile have the tile position of (2,1) and looking at the overview in image (3) you can see that the ID of the tile is 0.

    If this is makes sense to you, you can see that you can't work with a tile ID alone. Because it simply relates to what type of tile it is. You have to first tell C2 which tile coordinate you want to test.

    And you do that by using the condition "Compare tile at":

    To test it:

    So you just have to remember that Tile ID and Tile coordinate cant work without each other. The Tile ID is the tile graphic in the tilemap, and the tile coordinate is on the tilemap it self.

  • You do not have permission to view this post

  • The Tile ID is the tiles position in the tilemap. So you have to check for it like in my example.

    1. Which tile you want to check

    2. What type of tile is it

    In my example above I check the tile underneath the bullet and check if that is a tile type of 4, which are the ID you are talking about.

nimos100's avatar

nimos100

Member since 23 Sep, 2012

None one is following nimos100 yet!

Trophy Case

  • 12-Year Club
  • Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

16/44
How to earn trophies