Zebbi's Recent Forum Activity

  • You definitely don't want a huge sprite, as transparent pixels require rendering as well. 4 instances of a 1 px sprite would be the way to go, with negligible performance impact (especially if positioned just outside of the viewport).

    I'll have to fix the four instances with an every tick for my scrolling, which will decrease performance, won't it? Unless there's some behavior that keeps the object fixed to the screen regardless of scrolling, I can't use a different layer either, because I need the collisions on the scrolling layer.

  • The first thing that comes to mind would be to utilize 4 invisible helper line objects positioned at each viewport border.

    Exactly what I was thinking, I just wanted to make sure I did it right and didn't ruin any performance by having a hulking great sprite rendering. Would it be best to use a 1px sprite resized to the width/height and positioned in place?

  • I noticed this great example of gathering the coodinates of intersecting lines: https://dl.dropboxusercontent.com/u/475 ... Lines.capx

    How could this be modified to detect the edge of the window/viewport/camera (not layout)? It's a little hard for me to work out, since the viewport expression, unlike an object, has no angle data to extract, and there's 4 sides to work out separately.

  • If (OBJECT.X - OBJECT.Width/2) + MIN_VIEW > 0 |

    or

    If (OBJECT.X + OBJECT.Width/2) - MIN_VIEW < WindowWidth |

    If (OBJECT.Y - OBJECT.Height/2) + MIN_VIEW > 0 |

    or

    If (OBJECT.Y + OBJECT.Height/2) - MIN_VIEW < WindowWidth |

    where MIN_VIEW is the minimum amount of Pixels you want inside the window.

    Note: This is untested so try it yourself first and tell me how it goes.

    Just trying to think how to tie those four conditions into two OR blocks

  • Is there a way of testing if the X and the Y of something is "on-screen" but with a system expression? I think it's something do with dividing the width by the height or something?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • But think about it. You started with one object. You clone that 5 times, and then use a Family to bundle those together as if they are one object type again. You've just made your life so much harder.

    My suggestion is to just have one of everything, you create five instances, giving each an ID, from 0 to 4. Now you can pick any of those by the imagepoint #. This simplifies things greatly.

    Ahh yeah, I see what you mean, well those are just debug objects, the actual variables are being used for the tracer start and end points, and it works now with picking families, so I guess it's all solved!

  • Why are there 5 clones of everything? I think that's your first problem.

    Well, there's 5 different rays to find 5 different rays of hit points, but I've tidied the code down to using one set of events based on loopindexes.

  • You're going to have to tell me what I'm looking at here. There's a lot there.

    One more edit, it was the scope I've fixed, I just reordered the tracer via a subevent: https://www.dropbox.com/s/r0erae2dpy2sh ... .capx?dl=0

  • You're going to have to tell me what I'm looking at here. There's a lot there.

    I've improved it, or so I think: https://www.dropbox.com/s/r0erae2dpy2sh ... .capx?dl=0 If you check the Trace1 group, I've got local variables that adjust according to the direction the player is aiming, and each loop for the 5 different tracers resets and reuses it. I've picked each of the debug objects (the star, end, normal (hit) and line families) based on the loop index. It seems to work okay except one tracer in wanging off to the top, maybe it's cause of the 0-index or something?

  • Can you post a CAPX example? It's still not clear what you are doing/wanting.

    https://www.dropbox.com/s/r0erae2dpy2sh ... .capx?dl=0 I was suggested to try and use local variables instead of an array, so it's temporarily set up for that with the other ton of variables switched out, if this fails, I'll wire it up to an array instead. I also need to figure out how to pick a different instance for each loop from the families references in the actions for the debug objects.

  • Actually as I started writing, I came up with more questions, since I don't know your details.

    If each behaviour is in a Family and sets it's own specific variables, why aren't those variables on the family? Then there should be no need to index them.

    If that doesn't work, then getting back the the array idea, if you just have the single base object, then you can create a 5x2 array and use a container to connect the array to each instance. If there is more than one base object (grouped by families again) then you'd have to create the array object, store it's UID, and pick that array, by UID, when needed. This is obviously the most cumbersome mechanism.

    Excellent, now I don't have a massive experience with loops, so bear with me, do I call each of the behaviors with a "for each" and if so, I can't use loopindex, so what's the proper way of calling these different instances of the behavior?

    Just wanted to clarify, I think I've got my wording of behavior a bit wrong, I meant object/plugin Same thing, really though.

    The logo was getting a bit dated, and so many others use a cog in their design.

    I like the slightly vintage edge to the font.

Zebbi's avatar

Zebbi

Member since 20 Jan, 2014

None one is following Zebbi yet!

Connect with Zebbi

Trophy Case

  • 10-Year Club
  • x3
    Coach One of your tutorials has over 1,000 readers
  • Email Verified

Progress

12/44
How to earn trophies