EyezWidee's Recent Forum Activity

  • Okay thats actually pretty interesting I didnt know that, I try to avoid using every tick with variables feels like it hinders the performance especially when it involves webstorage. But I'll deff give that try also.

  • To get objects to spawn every 30 seconds you could try:

    Every 1 second - add 1 to (Variable)"Timer"

    If (Variable)Timer is greater than 30 - set value to zero

    Then on (system) on end of layout - (system) reset global variables

  • Looks like you'll need some trigonometry. The three Trigonometric functions are sine, cosine and tangent. In C2 their system expressions are cos, sin , tan // for inverse: acos , asin , atan .

    I'm in the process of trying to set the accelerometer's zero point to the users phone's position/angle he is holding it on start of layout. There's alot of trial & error involved but the purpose of it is to allow the player to play the game without compromise to the how they want to hold the phone to control their player since my game is 8 direction tilt based.

    Try working with Touch.Acceleration expressions and comparing two values. You can also create a variable & subtract from that every time the player moves.

  • Okay will do.

  • Is there a way I can use the cos & sin system expressions to set the zero point to the phones position/angle?

  • Yeah I just finished doing that - I set the startbeta to touch.beta on start of layout - I still have to hold the phone flat to move. The controls work fine I just dont know which expressions determine the angle/position the phone is being held.

    Event sheet: dropbox.com/s/nmksygz76e6ya2o/axis.PNG

    Example with flat zero point: dropbox.com/s/ytn6oqzn5k6irst/Accelerometer.capx

  • Current Event Sheet:

    <img src="https://www.dropbox.com/s/nmksygz76e6ya2o/axis.PNG" border="0" />

    The events currently in the game allow for true 8 directional tilt movement, even setting the balls position to scollx & scrolly at the start of the layout.

    The trouble I'm having now is setting the axis on start of layout so the controls can be based off the angle to player is holding the phone instead of a fixed number. I.e Player should be able to use the accelerometer controls wether the phone is horizontally upright or horizontally flat.

    Ex: dropbox.com/s/ytn6oqzn5k6irst/Accelerometer.capx

  • I wasnt able to set the axis on the start of layout. Setting the axis on the start of layout allows for the player to hold the phone at different angles without compromising the touch controls which are accelerometer based.

    I did learn tho that I could create a variable for "Axis" and set its value to: "Touch.Beta & Touch.Gamma". I would do that for both On Start of Layout & Every Tick but how would I set the appropriate controls since I need to compare the orientation to a value

    Seems like theres a Million and twenty plus incorrect ways of doing this & I'm hoping to minimize Trial & Error on this particular obstacle.

    Give it a Try : dropbox.com/s/ytn6oqzn5k6irst/Accelerometer.capx

  • Thanks for the insight, I'm gonna spend the night tryna figure it out.

  • Okay, I'll try that out. I think that might work for setting the axis but even then I'm wondering how does subtracting that difference upon start of layout or on button pushed allow me to use the accelerometer if I have to make up a value for the global variable

    & If I'm subtracting that difference every tick how would I write that code. Every Tick - Subtract [Difference] from Global Variable ? or from Alpha Beta Gamma?

    Thanks

  • I want to make a game that uses the touch accelerometer feature, where the player can use 8 Direction movement. How do I set this up & in a way that the axis is set at the start of the layout.

    • The player should be able to hold the phone at different angles but the axis is set on the start of the layout so based on that the player can move (8-Direction) using the accelerometer

    Example:

    dropbox.com/s/ytn6oqzn5k6irst/Accelerometer.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hey,

    I wanted to know if anyone has had any experience using tilt controls with the 8 directional movement behavior.

    Basically I have a game similar to Helicopter, what I want to do is allow the player to use the accelerometer to move Left, Right, Up, and Down. In the capx example below I was able to get the Up & Down movemnet correct but wasnt able to do so for moving left & right.

    Is there a way to set the zero point at the start of the layout so the player isnt positioned to a disadvantage when the game starts?

    Any insight on this would be much appreciated

    dropbox.com/s/zr629s8i3f6faw8/HelicopterTilt.capx

EyezWidee's avatar

EyezWidee

Member since 26 Mar, 2013

None one is following EyezWidee yet!

Connect with EyezWidee

Trophy Case

  • 11-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

13/44
How to earn trophies