R0J0hound's Recent Forum Activity

  • link updated

  • Read about the web storage or local storage plugins. They can be used to save values from one run of the game to the next. You can look in the manual, the tutorials and maybe even an example template included with C2.

    Next you'll need to get the time when the game closes and again when you open it again. You'll either need a third party plugin or use some JavaScript with the browser object to do this. Subtract the two times and calculate the money earned with:

    Amount= rate * time

    Search is your friend for more info.

  • Links updated.

    And no, there is no way to do it without a custom plugin. I've made one that can handle the deformed drawing, but it's not simple. Also the interaction with the "jelly" is all custom. None of the built in collision detection/response works with it normally.

  • link updated

  • Here's and old capx experiment of mine that may give some ideas.

    https://www.dropbox.com/s/df8jtstjva45m ... .capx?dl=1

    The cars don't really follow any traffic laws, they just go while trying to not overlap each other. It can fail when multiple cars enter an intersection at the same time, so some right of way is needed. The hack fix was to make the stop temporary and they'll eventually just drive over each other to keep things going.

  • It's "not equal to."

  • Just update winx and winy when you move the window with events and it will still be able to tell when a user moves it.

  • You'd have to test it and see how it performs on mobile. I've only tested the html5 export and I was never concerned with performance tests because this is just a wrapper to an existing js library.

    Also as with any third party plugin/behavior in C2 it won't work in C3 unless it's converted over. No plans to do so though.

  • angle(x1,y1, x2,y2) is the same as atan2(y2-y1, x2-x1)

  • I'm not sure there is an easy solution. You could look into steering behaviors as used in boids for a possible solution.

    You could also take digitalsoapbox's idea to detect what's around the car and then use a state machine to decide what the car will do.

    Like if it is clear in front of the car have it accelerate and drive in the best path.

    If a car is in the way, have the car try to steer around the other. If the other car then slows then have the first car stop overtaking and move to the best path.

    Basically look at what's around the car moment by moment and have states like "overtake" for maneuvers that take longer. It can get as complex as you want.

  • You could also use an array t do this and just store the uid of the object in a grid space (beware one object will have a uid of 0).

    So assuming you set up the level so at most one object is in a grid you could do:

    Start of layout

    --- array: set size to (layoutwidth/32, layoutheight/32, 1)

    --- for each sprite

    ------ array: set at (sprite.x/32, sprite.y/32) to sprite.uid

    so basically if a grid location is 0 it's empty otherwise it's the uid of the object in it. To do movement you'd set the grid of the destination grid to the uid first and then when the sprite arrives there you can set the old position to 0 again. Some instance variables can be used for that.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think it's only doable with nwjs. If you add the nw.js object you can access the x,y position of the window.

    Then to check if it changed you could do

    global number winx=0

    global number winy=0

    start of layout

    --- set winx to nwjs.windowx

    --- set winy to nwjs.windowy

    winx != nwjs.windowx

    or

    winy != nwjs.windowy

    --- set text to "user moved window"

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 157 followers

Connect with R0J0hound