rhg1968's Recent Forum Activity

  • You have two issues.

    1) You need to pass the runtime into your function jumpPowerBarRun. It should be jumpPowerBarRun(runtime)

    2) using runtime.objects.JumpPowerBar. That doesn't return an object for you to work with. It gives you access to functions to get instances that exist in your layout

    You would have to do something like runtime.objects.JumpPowerBar.getAllInstances() or runtime.objects.JumpPowerBar.getFirstInstance(). When you get all you will have to loop through them, but get first returns the object so you could then do runtime.objects.JumpPowerBar.getFirstInstance().width.

    There are other methods that you can use

    https://www.construct.net/en/make-games/manuals/construct-3/scripting/scripting-reference/object-interfaces/iobjectclass

  • Thank you for taking care of that so quickly.

  • First off love the plugins, I purchased them and they are really awesome.

    One thing I did notice is that if I tried advanced minification with the sample project you included it fails. Did you have any plans to make so that the plugins can be minified without any issues ?

    Thanks.

  • You create the instance then assign the width and height to it.

    const obj = runtime.objects.Player.createInstance(layerNameOrIndex, x, y);

    obj.width = 10;

    obj.height = 10;

    https://www.construct.net/en/make-games/manuals/construct-3/scripting/scripting-reference/object-interfaces/iworldinstance

  • You should be using runtime. callFunction("", x, y).

    This will get minimized properly.

    Normally to handle something that is accessing something that isn't minimized you would have to change something like this: funtion.doSomething() to function["doSomething"]()

  • It works now, Thank You !!!!!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have a personal license, but since C3 has been made open for the weekend it shows at the top free edition and my account name. If I try to load my project it says it exceeds the free edition.

    I can log out and log back in, but it still shows both my account name and the free edition tag and I can't work with my project. This is on version R195.

  • First you have to get a reference to an instance. Lets say you have one sprite called Enemy and there is only one in existence.

    const enemy = runtime.objects.Enemy.getFirstInstance();

    Now lets say that the sprite has a string instance value called Tag and I am going to display in the console.

    console.log(enemy.instVars.Tag);

  • Without looking at it too much my first guess as where to look is where you set the animation frame. It is zero indexed, so it would 0 and 1, not 1 and 2

  • Ashley

    I just submitted it, thank you

    https://github.com/Scirra/Construct-3-bugs/issues/3530

  • Mikal

    Just like anything there are pluses and minuses to either approach. I have had success with using the event sheet but I always reach a point where, to me, it seems convoluted to try and accomplish some tasks.

    I am a programmer so javascript is definitely more natural for me. I don't think performance is really an issue because you can optimize events pretty well and you can do the same with javascript, you can also write inefficient javascript code. You definitely have more control with how you accomplish things in JS, but that opens it up to any issues really falling on you as the developer.

    The biggest pluses for me with using JS are that debugging the logic is much easier for me using the chrome debugger than using the construct debugger. However, the info it provides such as utilization and FPS are awesome. Also being able to utilize functionality that isn't available out of the box is a good use for JS, whether you game is just using a little bit of it or the whole application is in JS. In my game I am able to manage users and store there current state object utilizing the PlayFab service api.

    The big downside to JS in construct is that there isn't a full blown development environment. It does provide excellent auto completion and syntax checking, but there aren't ways to search all files, refactor the name of a class and have it automatically rename all instances, find all references of a token, etc... So if you aren't careful with how you layout your code you can have a hard time finding things later on.

    Overall I think it depends on what you are comfortable with, your experience with JS, and whether your game can benefit from a little JS or a lot of JS.

    I have been programming in JS, C#, C++, and others for many years and find it easier for me.

    If you have any additional question, just let me know.

  • Ashley

    Here is a small example project that shows the behavior.

    I am using :

    chrome: 78.0.3904.108

    Construct3: r178

    If you run the example you will see in the console three object iterated over. If you perform an advanced minification, HTML export, on it you will see the count of properties iterated on the object are 0. If you change it from Object.Keys to Object.getOwnPropertyNames then it will work.

    https://drive.google.com/open?id=19-mik4je9LX6JinqBOcV8EvG_d-ezY2_

rhg1968's avatar

rhg1968

Early Adopter

Member since 6 Jun, 2014

Twitter
rhg1968 has 9 followers

Trophy Case

  • 10-Year Club
  • Entrepreneur Sold something in the asset store
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Coach One of your tutorials has over 1,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

18/44
How to earn trophies

Blogs