Tobye's Recent Forum Activity

  • Joannesalfa I noticed in your pic that your app takes up the entire screen nicely, however I can never achieve this without setting the window size to exactly the same dimensions as the test device. I have it set to full screen and have tried all different versions, but it just adds black borders and pushes it into a corner.

    So I just want to know how to accomplish true fullscreen mode? Am I missing something?

  • Hi iunkn,

    I have been using your plugin with no problems, until recently when I tried out a new project. I used exactly the same method as the last 2 but it comes up with this error when I try to preview it in VS:

    Unhandled exception at line 317, column 254 in ms-appx://e290a0ad-2288-4897-b4ad-abea770ee896/c2runtime.js

    0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'Nr'

    Highlighting this line:

    (new Windows.UI.Popups.MessageDialog("Note: this Windows 8 app is in Test Mode, designed for testing purchases. Before publishing, be sure to set Test Mode to 'No' in the Windows 8 object's properties.")).Nr();window.addEventListener("resize",function(){a.dl=

    Do you have any ideas what might be causing this or how to fix it? Thanks!

    EDIT: Sorry, figured it out. I hadn't minified the script upon export, although I hadn't done that with previous versions either, and they never had a window appear warning I was in test mode either. Ah well, so long as it works! And thanks, this is really a great plugin :)

  • keepee & superkew

    Thanks for your help guys! Keepee's method works just fine, but out of curiosity, how is that different from what I was doing? I mean it looks like your method and mine should achieve the same results.

    And thanks for debugging tip Superkew, I can see that being useful :)

  • Knifegrinder Ah okay, thanks for that! I'm not too good with technical stuff, but eager to learn, so it's good to have an idea to work with at least.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks, but that won't work as the objects don't change angles themselves. I want the object to always remain at angle 0, but to calculate the angle they would have if facing another object/location. This is because they are side-on sprites so if they rotated towards any position it would look crazy ^^

    When they use 'moveto', they do not change angles. They just move in that direction at the current angle.

    I have managed a solution, where it manually checks the instance of the minion and that of the pointer, then sets the animation. It is very doable actually, but nowhere near as clean as I'd like, doubles the number of sprites on screen plus I'm interested to see why what I currently have doesn't work.

    EDIT: Actually it seems my work-around doesn't work, as they get stuck on frame 1 when travelling in any direction except right for some reason.

  • If you want to add or change the speed of a bullet using a calculation you can use dt, so say you want to add 1 to the bullet speed 60 times per second, you go: everytick > set bullet.speed to bullet.speed+(60*dt).

    However, if you adjust the timescale bullets will automatically move in accordance with the new timescale. So if your bullets move at 50 pixels per second, then you set timescale to 2, they will move at 100 pixels per second instead without you doing anything else.

  • Then yeah, use dt. So if you want it to rotate 60 degrees per second, use 60*dt. 120 degrees, 120*dt and so on. It really is very simple once you get used to it, and really makes a big difference on slower devices!

  • Bullet behaviour uses delta time, I have used it a lot :) No need to do anything. I often use a gradual increase to delta time (e.g. everytick > set timescale to timescale+0.001) to have things speed up over time, and it works on bullets.

    If you want to exclude something, just set their time scale to 1 every tick too.

  • One method, if you want it to fade in in relation to the player, is to set the opacity of the object depending on the distance between object and player.

    So, set object opacity to 100-(distance(player.x,player.y, object.x,object.y*0.1)) for example.

    This way its visibility will always be in relation to distance, instead of just fading all the way in or all the way out. Not sure if you want this, but just thought I'd give an idea :)

  • Hey all,

    I am trying to make it so that when an object is moving towards a location, it will play the corresponding animation. For example, if their angle of movement is between 315 and 45, it plays the 'Right' animation.

    To calculate the angle, I have a family instance variable called AngleTracker which is set to 'angle(minions.x, minions.y, sprite9.x, sprite9.y)' as long as an enemy has instance variable 'Selected' to 1.

    I can get it to all work fine for right, down and left, but for some reason up (>225, <315) just won't work. They will still move in the correct way, but won't change their animation, instead always reverting to the 'Right' animation (>315 OR <45).

    I am guessing the issue has something to do with the fact that 'Right' uses an OR block, but I don't know how to get around that.

    Here's a link to the capx if someone could have a look for me, but be aware it uses 'moveto' and 'pushoutsolid' behaviours:

    dropbox.com/s/sb77z480hrvq4xl/Example.capx

    I also tried to do it by pinning a pointer to each instance and point them towards the target and having each instance play the animation in accordance with their pointer's angle, but instead they would all reference only a single pointer's angle. If you have any ideas on that method it would also help!

    And just quickly, if anyone knows which path finding plugin would work best for this type of game it would be nice, I have only had a quick look at them so far.

  • Have you tried just adding to timescale? If there are other things you want to move at a constant speed you could just set them to normal with each increase.

  • I tried it exactly as Keepee said and it worked perfect.

Tobye's avatar

Tobye

Member since 27 Jul, 2012

None one is following Tobye yet!

Connect with Tobye

Trophy Case

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

Progress

14/44
How to earn trophies