It probably works like this, at least that’s how I rely on it working.
Update loop
— run event sheet
— run wait events that are done
Here is a way to rotate around any point. Set cx,cy to the point you want to rotate around, and set a to the amount to rotate.
var a=1 var cx=100 var cy=100 rotate a degrees set position to (self.x-cx)*cos(a)-(self.y-cy)*sin(a)+cx, (self.x-cx)*sin(a)+(self.y-cy)*cos(a)+cy
Here is an alternate way. It checks the value with all the other values and if any match it randomizes the number again and re-does the check.
dropbox.com/s/z0an316nusgc6nu/unique_random_list.capx
If you were only concerned with the values 1 through 6 you could do something simpler like this too.
dropbox.com/s/mb9he4ke03d7r23/unique_random_list2.capx
sir lolz
Not with this plugin. The paster plugin supports that.
You have to loop over the array backwards.
Var i=0 Var count= Array.width Repeat count times — set i to count-loopindex-1 — array.at(i) == 0 — — remove array at index i
Or you can
Var i=0 Every tick — set i to 0 While i<array.width — array.at(i) == 0 — — remove index i — — subtract 1 from I — add 1 to i
Develop games in your browser. Powerful, performant & highly capable.
Idk, using a wave collapse function doesn't seem to keep everything connected.
Here's an experiment with it. I don't think I provided enough tile cases since it can't resolve a few tiles. It was interesting to mess around with though. It probably could be made to erase those dead ends to try again. It would also be nice to give some tiles more weight than others.
dropbox.com/s/grb9i41yhpy8uhp/waveFunctionCollapse.capx
First you find an equation to get the circle that goes through the three points, and then there was some extra math to transition from one angle to the other to plot points on the arc.
dropbox.com/s/rwk6kjs9brx8myr/arc_through_3_points.capx
Probably can do it with a maze generating algorithm. Or something like that.
en.m.wikipedia.org/wiki/Maze_generation_algorithm
Edit:
One possible way using prim's algo.
dropbox.com/s/58l1kqgcdlse96x/primsAlgo.capx
It’s a special thing. There are many ways to do it.
Here’s one possible way.
construct.net/en/forum/construct-2/how-do-i-18/resize-handles-example-48892
Oops. I’ll need to fix that and reupload. You’d add it to the velocity update event.
Set vx to (self.x-self.px)/step*damping
Set vy to (self.y-self.py)/step*damping
Let me know if there are any other features needed.
Ah, I see what you mean. You want damping. Re-download from my post.
There are two ways you can introduce damping. One is to change damping from 1 to say 0.995. Another is to make the timestep bigger, so change step from 0.0005 to 0.005 or something. I had used a small step initially so that the balls would end up about the same height.
I agree with dop, seeing a project or at least a picture of your events would be helpful. Best I can guess it's likely some small logic or picking aspect you're overlooking with your events.
Member since 15 Jun, 2009