WarpedOldMan's Forum Posts

  • I'm not very familiar with infinite scrollers. I'm not sure how well it will perform, but you could just implement your own scrolling (with respect to the sky texture). So set the Sky layer's horizontal parallax to 0, and then get the player movement and set the sky texture's position to the amount the player moved * 0.2 etc.

    I don't remember for sure, but I believe that C2 doesn't exactly allow you to distinguish between world coordinates and draw coordinates of an object. The way the parallax is implemented means that you need to do some translation to get an objects "world coordinates" or position with respect to your main layer in this case.

  • Could you post a screenshot or video demonstrating what is happening? Also maybe show us a screenshot of the event sheet or even post the project.

  • I had a look around, but I can't find it anymore, sorry. Are you having a similar issue? I might remember some of what I was doing at the time, and how I (sort of) fixed it.

  • Yeah, I think that might have worked. It turns out that my problem was something else entirely though this time. I was using viewportleft(layer) but with the wrong layer. One that had a scale rate greater than 0. Thanks for your help though.

  • I'm going to add another question to this, relating to my first question.

    So, in my game, I have a minimap. The minimap is 200x200. When the mouse is over the minimap, I get it's position on the minimap treating the topleft of the minimap as 0,0.If the mouse is on the very center of the minimap, it is at 100x100.

    I call this number mouse_minimap_x and mouse_minimap_y respectively for each axis.

    Then what I do, is take that number, and do mouse_minimap_x/200. This gives me a ratio. So if the mouse were in the very center of the minimap, I would get 0.5.

    I call this new number the mouse_minimap_ratio_x. I take this and do mouse_minimap_ratio_x*layoutwidth. This tells me where to move the camera on the layout. Which, in this case, would be to the very center of the layout.

    This all works fine normally, the problem arises when I set the layout scale to anything other than 100%. The camera is moved to the wrong position, often very far offset from where it should be.

    To solve this, I tried making a new layer, with a scale rate of 0, and put the camera on that, but that changes nothing.

  • Great, thanks for the confirmation. I had tried placing large tiled backgrounds that filled each layer to compare, but it wasn't obvious to me what was happening.

  • Do you have a lot of intensive actions on a "On start of layout" event?

    In my project I create a few thousand objects on the start of the layout, and it always takes a few seconds to load the layout. I just have the layout start with a simple screen with the text "Loading" on it, which I then remove when the game is fully loaded.

  • I might be wrong about this, but, if the canvas resizes, ViewportLeft might not always = 0.

    You could try making your own ViewportBottom. I think it would be something like scrolly + (WindowHeight/2). This might not work though if you are using a layer with a parallax of 0.

  • I have 2 layers, one with a scale rate of 0%, and another with a scale rate of 50%.

    Now, if I zoom out, that is, set the layout scale to something like 50% does this happen?

    Or does this happen?

  • So, just to clarify, when "ene1" fires a "ene1pocisk" (which has the bullet behavior) you want this "ene1pocisk" to travel horizontally (in a straight line) from it's starting position?

    I have your project open, it looks awesome by the way, so I'll try help if I can. It's been quite a while since I used CC, but I have a soft spot for it so I decided to get it working again.

    Also, regarding your first question, which object is using the LOS behavior? What are you using the LOS behavior to do?

  • Ok, that didn't take as long as I thought it would, I tried some more things and discovered something.

    Although the effect parameter states that it will accept values of 0-100, I think this is a little misleading.

    In my test project, I got the cursor's %position on the texture, and if this value goes above 100% then the light behaves correctly and appears to move off into the distance the further the cursor is.

    Take a look at the example if you want to see what I mean.

  • I just played around with the bump-mapping effect a little bit.

    From what I can tell, the effect is (understandably) confined to the sprite you are applying it to.

    There are 4 parameters Light X, Light Y, Light Z, and Intensity.

    Light X and Light Y both start out with values of 50. Now, I think, though I'm not completely certain, that these values correspond to %of distance on each axis.

    So Light X of 50 is half-way across the texture or, 50%. And, a value of 100 would place the light source at the far edge of the texture

    I might be wrong, but if this is how it actually works, then I don't know how I would make use of this in a game since this basically means that the light source needs to be static. And if it's static, then that reduces the usefulness of the effect greatly, since you can just bake the effect into the texture before-hand.

    I'll try playing with this more to see if I can figure out anything more.

  • Hmm, ok, I'll try something like that, thanks.

    I still find it strange that an object can be clicked when it isn't visible.

  • I've implemented a custom check-button in my game. The check-button consists of a sprite and a text object.

    If the mouse clicks on either the sprite or the text, the button's state is toggled.

    Sometimes a check-button is set to invisible. And while invisible, I disable the sprite's collision, so that clicking on it will have no effect. But for some reason, I can't disable collisions on the text object from what I can tell.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That really seems like it should work. I've tried it out and I'm still having the trouble getting the mechanism that uses this to work. But I'll have to assume that the problem is somewhere else then.

    Thanks for the help.

    Edit: I got things working finally. I'm actually not sure now if the problem was ever with the inverted pick by UID condition. But your suggestion is working fine now anyway. As is often the case, my problem was just a couple stupid mistakes that I overlooked.