Nepeo's Forum Posts

  • All the inbuilt movements are framerate independent, that is they will move at the same speed on 2 devices with different frame rates.

    You may see some other minor variances caused by larger timesteps.

  • I would recommend storing the values in a dictionary, then placing it into a singular local storage entry with the dictionary.AsJSON expression. This allows you to store other things in local storage, and index your information easier.

    You might want to consider if you want to store other information about the level ( score, time, etc. ) in which case you might be better off using the JSON or Array plugin instead. Again storing it in local storage by converting it to a JSON string.

  • If you take a look at the developer tools you will see the request is failing because you haven't set any cors headers for your PHP script, and preview.construct.net is a different domain to yours.

    Also that script is firing a network request every tick, you probably want to do it less often than that...

  • StefanN If you could provide a project, then I'm happy to test for you. I know relatively little about PHP. I've used it before and generally found it frustrating to be honest, but I can help with the JS parts.

  • I don't seem to be having any issues with the server right now, is this still persisting for you? I'm interested in that crash report as well, I'm not aware of any crashes in the build upload so I would like to resolve that.

  • It's difficult to tell the exact reasoning behind the rejection. From what I've heard they tend to be quite cryptic with the reasoning even if they have definite reason for it.

    I would recommend that you read the section on performance in the app store guidelines as they have said and consider if any part of your application doesn't meet them.

    We're not aware of any issues related to publishing games to the app store with Construct itself. If you cannot find anything obvious in the guidelines then I would recommend trying to open a dialog with the app store review team and trying to get more detail. If it does turn out to be an issue with the runtime itself or one of our plugins please file an issue on our bug tracker.

  • Asmodean is probably right here, try sticking a breakpoint on the first action of "on start of layout" and the first sub condition of "tiles on created" to see when and how often those are being triggered.

  • I expect it just hasn't been implemented yet. Ashley would have written that code, so I don't know if there is some reasoning why it didn't make it into the first version or if he just forgot.

  • I used to know the maths, been awhile since I've studied kinematics but I can probably guess most of it.

    If I'm visualising the arc correctly you have 2 variables ( angle and initial velocity ) as well as the position of the player ( which is technically constant in this situation ). As there are 2 variables you end up with effectively infinite combinations, so it can't be solved easily. If you pick an arbitrary value for the angle ( say 45 degrees ) and just vary the power there should only be 1 solution, so we can solve it.

    I tried to work out a way to do it if the player is on a different height to the enemy, but couldn't figure it out ( guess I'm a bit rusty ).

    Consider vertical movement to the top of the arc ( where the vertical velocity will be 0 and acceleration will be negative g )

    0 = u + ( -g ) * t
    u = g * t
    t = u / g
    

    We also know that as there is no air resistance that no horizontal declaration occurs, hence when considering the distance travelled initial and final velocity are the same

    s = u * t
    

    As the angle is 45 degrees the initial horizontal and vertical velocity are the same. The arc is symmetrical so we know that t to the top of the arc is exactly half the total time. So let's combine the equations.

    s = u * (2 * (u / g))
    s = 3 * u / g
    s * g = 3 * u
    u = (s * g) / 3
    

    Little g is a constant, and we can calculate the horizontal displacement trivially so you can figure out the initial velocity quite easily. I'm not sure how your actually simulating this, so you might have to fudge the math a little to match up. Changing the target elevation relative to start break the symmetry of the arc, which makes things more complicated to work out.

    I think my math is right, but it's untested and I haven't done much like this for around a decade

  • Is it showing you this error in the editor? I forgot there's a bug in the current beta that the script validator doesn't know that script blocks are async contexts.

    "fetch" returns a "promise" object, there's 2 ways of using a promise. Async/await is the newer, and easier to write way. But there's an older version which uses callbacks. The older format will be accepted by the script validator without any problems. Try this instead:

    	const url = "https://www.mydomain.com/upload/get_content.php";
    	const data = { posturl:document.referrer };
    
    	fetch(url, {
     		method: 'POST',
     		body: JSON.stringify(data),
     		headers:{
     			'Content-Type': 'application/json'
     		}
    	})
    	.then(res => res.text())
    	.then(data => runtime.callFunction("pub_id", data));
    
    
  • You do not have permission to view this post

  • Ah yeah the piece of code I gave you expects to be used in an event sheet script block. If your not using it like that you will need to place it into an async function so that the "await" operator works.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I've made some changes for the next release so that leading/trailing whitespace is removed on any Admob ID and the privacy policy. Should stop people getting caught out by this in the future. Thanks for bringing the issue to my attention.

  • The error isn't particularly descriptive, it's coming from the Admob SDK. I backtracked it and it's not actually related to the privacy URL, although it can generate the same error message. You have a space at the start of your publisher ID, which it's using to build a URL. Remove the space and it works fine.

  • There's a few things here, but I think the key thing is that $.post is a jquery function, jquery is no longer included in Construct so unless your including it yourself it won't work.

    I'm a little unsure about some of the edges here, but if I was trying to implement this now I would use:

    const url = "https://www.mydomain.com/upload/get_content.php";
    const data = { posturl:document.referrer };
    
    const res = await fetch(url, {
     method: 'POST',
     body: JSON.stringify(data),
     headers:{
     'Content-Type': 'application/json'
     }
    });
    
    const data = res.text();
    runtime.callFunction("pub_id", data);
    

    As in inline script in the event sheet. It uses the "fetch" API, which is native instead of being an external library.