jatin1726's Forum Posts

  • Hi Everyone,

    I need your expert advice and help in auto accelerating a car using car behavior without any touch or tap of button on screen? Is it possible? I tried this on start layout > simulate car pressing accelerate. But it is not working. In my game car will auto accelerate but will be controlled by steering. I have already made a version with car accelerate on button press, now requirement is car should auto run without any button press. I am sharing screen recording of what I have already made till now.

    screenrecording : youtu.be/k41-VGmu8Mg

    Please help me in this issue.

    Regards,

    Jatin

  • here you go:

    https://www.dropbox.com/s/zcx7dest2giirh6/zoom_blue_box.capx?dl=0

    Oh GOD, u do magic always. Its amazing and working as expected (though I am still trying to figure out your magic trick and mistake I was doing). Thanks a lot :)

  • You didn't do anything that I suggested in my previous comment..

    Start with my file zoom_sprite.capx, move blueBoxScale from global to instance variable. Save UID in some variable on first touch. On second touch don't check for "is touching sprite" (because the second finger may not be touching the box) and pick the box by saved UID instead.

    Hi DOP, I retried your suggested Solution by keeping steps close to your guidance but now box disappears on touch and nothing happens, can you help me out plz?

    CAPX link:

    touch.affle.com/explorations/mohan/zoomtouch/zoom_sprite_test.capx

  • Yes, everything is possible. Use instance variable instead of the global variable to store scale factor for each box. On first touch check which box is touched (maybe save its UID in another variable), and then in event #2 pick this box by UID and scale this box only.

    Hi DOP,

    I tried and now I can zoom in the bluebox, ie. I can pinch to reduce the size of box but not able to make it big by pinch out. attaching capx. i am sure something I am doing wrong. Looking for your guidance here.

    touch.affle.com/explorations/mohan/capx/testtouchzoom.capx

  • Yes, everything is possible. Use instance variable instead of the global variable to store scale factor for each box. On first touch check which box is touched (maybe save its UID in another variable), and then in event #2 pick this box by UID and scale this box only.

    Ok I am gonna try this.

  • Try this:

    https://www.dropbox.com/s/t05m2m2dujbrvas/zoom_sprite.capx?dl=0

    You can also scale individual layers.

    Thanks DOP, you solution seems to be working fine but it allows user to pinch anywhere on screen and scaling starts of blue box. Can I make it like only pinching box make it scale in/out. For example I have two blue boxes and I want to pinch zoom out box 1 and pinch in box 2 in same layer.

    Is this possible?

  • How do you do the drawing part? I'm guessing you create new sprites at the mouse/touch position? Simply add new points to the spline path at the same time. Just make sure not to add two points with the same coordinates, Spline doesn't like it.. See this post:

    https://www.construct.net/forum/construct-2/how-do-i-18/hi-i-have-a-problem-with-rex-s-136098

    Many many thanks DOP, it helped me fix the issue. God bless you.

  • Sure, create a variable "blueBoxScale" and change it the same way. Set sprite scale to this variable.

    Hi Dop, I tried this but not working. DOnt know what wrong I am doing. Here is my capx.

    touch.affle.com/explorations/mohan/capx/zoomimagetouch.capx

  • You can.

    https://www.dropbox.com/s/7l2a6i2alj1mtyt/Spline_demo.capx?dl=0

    How to create points when drawing a line realtime using spline plugin? Currently it needs tap to create new point which breaks the flow of drawing a line.

  • How can I prevent my game restarting with refreshing of browser? I use facebook plugin to login, but if i refresh the page will appear the layout 1 with no login.

    You can restart the game layout and keep facebook login to separate screen to avoid reload.

  • jatin1726, see Rojo's first comment in this post.

    Also, this may be easier to do with the Spline plugin:

    https://www.construct.net/forum/extending-construct-2/work-in-progress-addons-30/behavior-rex-spline-114539

    Problem with spline plugin is we have to set points before hand. We cannot draw line in realtime.

  • Possible to get capx. Link is not working anymore

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Just in case your Dropbox file gets deleted one day, I'm posting the event view here so that people will still be able to re-create it:

    https://i.imgur.com/cN6Qv0w.jpg

    Wonderful idea, thanks.

  • Sure, create a variable "blueBoxScale" and change it the same way. Set sprite scale to this variable.

    Thanks I will try it and share here if it works.

  • Have you tried my demo? I posted it here a few times:

    https://www.dropbox.com/s/p40ibb75m9g8z8j/ZoomTouch.capx?dl=0

    Run in Chrome, it may not work very well in Firefox due to some bug with touches getting "stuck".

    Very nice DOP, thanks a lot for this. Is it possible to zoom through pinch out/in touch only one blue box instead of whole layout?