AlexSV's Recent Forum Activity

  • I see. Since mine doesn't have solid walls I suppose it's good that I have it!

    One last question. I am not familiar with local variables. Why not just use global variables? Unless the variables aren't needed outside of that particular sub event. Do local variables only exist within that sub event and basically cease to exist outside of that particular event?

  • Is this what you are trying to make?

    https://howtoconstructdemos.com/auto-zoom-and-scroll-the-screen-to-fit-multiple-characters/

    This is literally exactly correct. I sort of understanding how this is working, but I was wondering if I could ask some clarifying questions. I don't fully understand it, and while I could just copy it and walk away, I'd like to understand it more fully so that I can do it myself in the future.

    It says for "min" and "max" expressions that it is calculating the minimum and maximum of things, so I assume that if I put in, say, max(3,5,Player.x), then, unless my player x was bigger than 5, it would always return 5, right?

    So what those four expressions in the "for each" do is, for every player that is on the screen, calculates the farthest point of the relevant bounding box for that object, then compares it to the previously calculated value from the previous cycle (which is why max is set to 99999, where no object would reasonably be). I see it's using a "min(max" or "max(min" at the very start of each expression, but I'm not quite sure why that part is done...

    After all that is done, it finds the center of the box by adding the values together and dividing it by 2, and lerps via delta time x 16 (this number could be adjusted however I want, I'd assume).

    It calculates a value to scale the layout to by dividing the difference of the min and max values by the original size of the viewport, then clamps it so it can't go beneath 1.

    I'm a little shaky on the math for the viewport calculation (because I am bad at math) but I think I understand the concept.

  • Hey there, everyone.

    I'm struggling with the concept of moving a camera around. I have this piece of code so far...

    The concept for the non-disabled code is that I have a sprite with the "scroll-to" behavior on it that constantly sets itself between the Player and the Goal. That code is working fine, but when the two get too far apart, the objects both disappear off of the screen.

    The disabled code represents my attempts so far to figure out how to properly scale the layout so that both objects are always visible on screen via scaling of the layout. I do realize that I basically am looking for a number between roughly 0.4 and 1 (depending on the distance between the objects) and that I also need to stop the camera from zooming in when I reach a scale of 1. But in order to do that, I first need to find the formula that would let my camera zoom in and out. The problem with my current setup is that it actually zooms out when the two objects approach, rather than zooming in, and I seem to be hitting some kind of brain fart that isn't letting me proceed. Maybe I've looked at this code for too long, haha.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hey there, everyone.

    I'm using Construct 3 to teach my 6th-grade children simple computer logic and to make games for a small arcade cabinet in our classroom. Today is the second group of kids I'm teaching, and one student, in particular, can't use Construct at all. Every time he loads up Construct in his browser, it turns red, crashes, and gives an error. Every other student is fine, this is only one particular student. His account activation went perfectly well, and he also tried to restart his computer, which didn't help.

    Here is the error.

    Error report information

    Type: unhandled rejection

    Reason: Error: The source image could not be decoded.

    Construct 3 version: r164.3

    URL: editor.construct.net

    Date: Tue Oct 01 2019 13:09:28 GMT-0700 (Pacific Daylight Time)

    Uptime: 2 s

    Platform information

    Browser: Chrome

    Browser version: 77.0.3865.90

    Browser engine: Chromium

    Browser architecture: (unknown)

    Context: browser

    Operating system: Mac OS X

    Operating system version: 10.13_6

    Operating system architecture: (unknown)

    Device type: desktop

    Device pixel ratio: 1

    Logical CPU cores: 4

    Approx. device memory: 8 GB

    User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36

    C3 release: r164.3 (stable)

    Language setting: en-US

    WebGL information

    Version string: WebGL 2.0 (OpenGL ES 3.0 Chromium)

    Numeric version: 2

    Supports NPOT textures: yes

    Supports GPU profiling: yes

    Supports highp precision: yes

    Vendor: Intel Inc.

    Renderer: Intel(R) HD Graphics 6000

    Major performance caveat: no

    Maximum texture size: 16384

    Point size range: 1 to 255.875

    Extensions: EXT_color_buffer_float, EXT_disjoint_timer_query_webgl2, EXT_float_blend, EXT_texture_filter_anisotropic, OES_texture_float_linear, WEBGL_compressed_texture_s3tc, WEBGL_compressed_texture_s3tc_srgb, WEBGL_debug_renderer_info, WEBGL_debug_shaders, WEBGL_lose_context

AlexSV's avatar

AlexSV

Member since 25 Apr, 2019

Twitter
AlexSV has 1 followers

Trophy Case

  • 5-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

7/44
How to earn trophies