mindfaQ's Recent Forum Activity

  • creat object

    set position to x = random(scrollx, scrollx + originalwindowwidth / 2); y = random(scrolly - originalwindowheight/2, originalwindowheight))

    Or if you mean the right edge of the screen for x it is not random, but just scrollx + originalwindowwidth / 2

    hope I didn't make a mistake. scrollx and scrolly should be the middle of your window and half of the screen width added, you will be at the edge; for your understanding.

  • It's easy mate:

    dt might change slightly, but it's roughly 1/60.

    Each time you do that lerp expression, you move about 1/60 of the distance between those two "points". Each time you move closer means the distance between the two points will get smaller. So you move 1/60 of the smaller value the next time. This results in the movement continuing to get slower, while you never actually reach the destination (it's a bit similar to "Achilles and the tortoise").

    If you wanna do linear interpolation between two points with lerp, you need three instance variables: starttime, startvalue and duration.

    Then do a:

    start movement: set sprite.starttime = time; set sprite.startx = sprite.x

    set duration = 2

    sprite.starttime + duration >= time-dt: set sprite.x to lerp(sprite.startx, 800, clamp((time - sprite.starttime) / sprite.duration, 0, 1))

  • Ich finde mehrsprachigen Support bei Skript/programmiersprachen eher fragwürdig, sollte lieber alles konsistent sein - dann ist der Austausch untereinander auch einfacher. Genau wie bei Grafikprogrammen, wo man sich auch die englische Version installiert, damit man bei den Tutorials weiß, was gemeint ist bzw. sich mit fremdsprachigen Menschen austauschen kann.

  • lerp(1,800,dt) does not create an easing effect but will vibrate near at value 1.

  • There might be shorter solutions, but this one is stays pretty readable imo (events 2-5).

    Made a little game out of this:

    http://strategy-investor.de/mgz10/evade/

    have fun

  • If you don't want to use up a lot of sprites, you will probably paste sprites to the canvas/paster plugin or draw paths with those (not sure about the paster plugin, has been too long since I've used it).

    As to the tree itself, think about:

    • branching of one line into 2 or more at a splitting angle.
    • a max. amount of branching allowed.
    • number of branches per split
    • Line lengths (stem is longest, little branches the shortes)
    • will it get thinner each branch or continually? continually will be more coding work
    • add randomness (lengths, angles, thickness, the possibility for a branch to end before the branch amount maximum)
    • leaf "branches" after x-th branch level?

    Well, I guess it depends on how complex you want to go into this matter and what effect you want to achieve exactly with this.

  • hey guys, I managed to do a small update:

    version 0.7; current number of events: 98

    https://copy.com/vi8T3jeZALnD8PFR

    http://strategy-investor.de/mgz10/vnengine/

    I'm encountering really bad fps, although most events are triggered. Guess the problems are the transparent, "big" sprites. Not sure how to improve the performance - if someone knows how to improve it or sees the fault for the bad performance in something else - please inform me <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">.

    newly added:

    • auto mode
    • skip mode
    • voice functions to play sounds for corresponding text lines

    reminder for me personally what needs to be added, that will hopefully fit in the two remaining 2 events:

    • disabling the save and load button while there is no save state selected
    • sfx volume and hopefully loop control via the script
    • switch from webstorage to localstorage, which was newly added
    • give each button its own animation, so code gets more readable and exchanging buttons more straightforward

    Also forgot which bugs occured with saving/loading, need to check that out, still. If you stumble upon one, let me know.

  • Yes, there is an easier solution:

    [your triggering event]

    --pick enemy with enemy.iid = 0: destroy

  • Well, I've tried trigger once with this array loop:

    the counter just continuously went up, so I think there is a bug with that combination (or I understand the trigger once or loop incorrectly).

    You could try to work around it by either:

    a) use another global variable, instance variable or value in another object to basically save, whether this event already occured; set as condition occured = 0 and the loop afterwards and inside the event set occured = 1 somewhere

    b) pack it inside a function and call it when needed (my preference)

    Other than that comparing values in conditions should work flawlessly, at least I never experienced any problems there with expressions in brackets. Other problems could stem from comparing different types of objects (comparing strings with a number, or trying to add a number to a string).

  • Problem Description

    Proportions and coordinates are not correct in fullscreen scaling off mode, when the zoom mode of the page at launch is at something different than 100%

    Attach a Capx

    https://copy.com/LExZ1imGnwNYOCvO

    Description of Capx

    A simple layout with no fullscreen scaling that will save a screenshot for comparison purposes.

    Steps to Reproduce Bug

    • start the layout preview at 100% zoom, see that the layout looks correct / as in Construct 2
    • set the preview page's zoom to something else than 100%, so for example 75%
    • start the layout preview again or reload the page -> proportions / coordinates are wrong

    Observed Result

    Proportions (sprites to window size) and coordinates are wrong (in relation to for example mouse.x / mouse.y).

    Examples:

    Subscribe to Construct videos now

    (difference shown between starting at 100% zoom and 90%)

    coordinates being messed up:

    in this example the blue sprite cube's origin is at the middle of the blue cube. Mouse was at roughly the middle of the white window, mouse.x was at 2 as the text shows. The sprite's x coordinate was set to mouse.x, so the cubes should be centered. Instead they are in the left part of the window.

    Expected Result

    Window size should probably set up in the project multiplied by the zoom factor. Setting a sprite's position to mouse.x and mouse.y will set it's position to where the mouse pointer is when the sprite's origin is at it's middle.

    Affected Browsers

    • Chrome: (I will not install this browser, someone else may test it)
    • FireFox: (YES)
    • Internet Explorer: (YES)
    • Opera: (YES)
    • NW.js: (does not have a page zoom functionality I think, so not relevant there)

    Operating System and Service Pack

    win 7 64bit most recent sp

    Construct 2 Version ID

    r201 beta

  • You've misread my post. I will open a new topic if you prefer it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Wouldn't it be enough to put the function on a event sheet that is only included in that one layout, but not the others?

    If that doesn't work, you can put in a condition to the function "layoutname = "the name of your layout""

mindfaQ's avatar

mindfaQ

Member since 12 Oct, 2013

None one is following mindfaQ yet!

Trophy Case

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

Progress

13/44
How to earn trophies