Tobye's Recent Forum Activity

  • I would suggest just using the timer behaviour. timer(name) <= 0, create timer (name, instance variable).

    on timer(name): Add 1 to "time"

    Effectively does what you're after with less room for trouble and more room for additions.

  • philx - maybe my last post in this topic will help you: scirra.com/forum/how-do-i-get-the-layout-scale_topic79444.html

    I think this method of UI placement is far better than just slapping on an anchored sprite as it will always be exactly the right distance from the edges. Just make the layer they appear on to have parallax 0.

  • distance(startingline.x, 0,player.x,0) ;)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • No problem :) I think this aspect of game building is very important, but it's not as clearly documented/tutorialised as it should be. I have seen many people asking similar stuff and getting all sorts of conflicting answers.

    For portrait mode, just try to lock the game to landscape using the browser object. Then also try to make all your UI elements use viewports for placement, and if necessary, adjust their width/height scale to the window scale as I previously explained. This will ensure they are always visible on screen, even when the screen is terribly distorted. To see this in action you can try resizing the C2 editor window itself and see how all the panels keep their place, even while the layout space shrinks. Using this method will make sure no essential controls or information is ever inaccessible, regardless of screen sizes and orientations.

  • No problem! Just have another condition that says 'is CNTRL down', then right-click it and select 'invert'. This means the condition is only true if the CNTRL key is NOT pushed.

  • Yep! Same for any direction you want. Up-right corner is 315 degrees for example.

  • I would also love to know this! I have hacked about by changing the angle of motion in relation to the distance and angle of the target, and while it works, it never works exactly right. I would like to know the formula for this.

  • - The layout scale isn't changing, just your view of it. You are only choosing to display 400x300-odd pixels, but then they are stretched to fit the entire screen.

    You can check viewportRight and viewportBottom values to see the size of the screen. Then divide by the original size. This will give you the value of how scaled it appears. But keep in mind that the exact scale may be off, as the width might be 0.3, whereas the height might be 0.4, so there is no single 'window scale'.

    But I think you are just after another scale mode. Try them all out and see if any work better for you!

  • You can just use 'move at angle'. 180 for left, 0 for right. And always remember to set the amount to move as a multiple of dt! (for example: 'left arrow is down' > 'turret move at angle 180, 260*dt').

  • Tig0r - No problem, glad to help! :) There are ways to make the movement exact, but I haven't done it for a long time so don't remember how to. You can search the forums for many answers on it, but I believe they all take a little work.

  • I would just do 'for each "ghost"'+'"eaten" is playing' + 'trigger once' = find path to ghost home. Or maybe link it to the event that kills the unit. So like: '"ghost" health =< "0"'+'trigger once' = 'find path to ghost home'.

    How you have it now will continue to loop the pathfinding. Even if you add trigger once to what you have, it will still loop because as soon as it finds a path it is no longer finding a path and the animation is still playing.

    If your pathfinding is failing, it could be that you have the cell sizes too large, meaning they can't fit through the gaps. Try lowerig it to something ridiculously small like 2 and see if it works then.

    Also a capx can really help us to debug ;)

  • I see you have 'is calculating path (inverted)' + 'animation "eaten" playing'. This could be your problem, because as soon as it finishes calculating, it is no longer calculating and will keep trying.

    So check to see if they are under a trigger condition (I can see they are a sub-event, but not of what). If not, you should add one like "on animation 'eaten' started".

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