So best I understand it the crosshair is moved with the mouse, and then the camera is moved so it's both looking at the crosshair and is behind the player?
To do that I set the crosshair position to the mouse position on a 2d non parallax layer.
To make the camera delayed behind the crosshair I positioned a lag object that lerps toward the crosshair.
Then I calculate a unit direction vector from the player to the lag object.
We can then calculate a position a certain distance behind the player to use as the camera position, and then look at the lag object.
uc8819e7314763c0e3ea1c00135f.dl.dropboxusercontent.com/cd/0/get/CiHxl8miN4UBQny2gUuqV8qrQWYcueZ8tZ3na5L-Burkh2hKGzeMLHpnchcgtm63tFj2TbsmwGo9jUOXmSDTB5IOxonMbooYg12HIxdflMNSbZ7IZWmXZ2jezSkUH9Ml3JsHz3JXIK5jEL5eMFpALFeQ/file
winkr7
Turns out you were right, it runs the next tick. Guess looping backwards over the list works to do that.
waitlist = [] time = 0 function wait(t){ waitlist.append({when:time+t, events:followingEvents}) } while(gameRunning){ time += dt run(eventsheet) for(i=waitlist.length-1; i>0; --i){ if(waitlist[i].when<=time){ run(waitlist[i].events) waitlist.remove(i) } } }
Not sure. We could test that with something like this:
Star of layout — set text to tickcount — wait 0 seconds — set text to self.text&tickcount — wait 0 seconds — set text to self.text&tickcount
Depending on how wait is implemented we could get 000 or 001.
Edit: I’m inclined to think it would be 000, aka all wait 0 after a wait will be run. The logic may be similar to the following. If I wanted it to delay to next frame it would be more complex I’d imagine. We could always look at the c2 source to see how wait is implemented too.
waitlist = [] time = 0 function wait(t){ waitlist.append({when:time+t, events:followingEvents}) } while(gameRunning){ time += dt runEvents() for(i=0; i<waitlist.length; ++i){ if(waitlist[i].when<=time){ run(waitlist[i].events) waitlist.remove(i) i-=1 } } }
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
Develop games in your browser. Powerful, performant & highly capable.
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.
ucc7df9bc1509f4fa9c5bdc918de.dl.dropboxusercontent.com/cd/0/get/Ch5dFjkmnOqQW_U5IYQbxsnhRF7AjIVWChwQWoH0z4Os27XwX1-9grnzBtL0PRIKEYhqpHCa80aSZ3aXIXWzFIENcKzfozkW5TzX6Ak2pkjeDgwWREjSIWYXuKaEhI8R84Qwzg3IZg_X1l_VrhRCegc8/file
If you were only concerned with the values 1 through 6 you could do something simpler like this too.
uc9de496855e4d4d4cf59afe0e24.dl.dropboxusercontent.com/cd/0/get/Ch7vWXd_2Jjdoxr09sCUHrsfZizLMfaLWKYmo0edLm0o_q7FHjTNPKkkvLTEdocPUh_zhQKpJYCPtsb98oOKYDSZGrS6dcVyjZYKUDcj1OBkz7etdCnOV_OdhJAKjCptv7wcL4tpkWOH-9MtdrWu8IOy/file
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
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.
uce94f323c223a8be0eb997c4047.dl.dropboxusercontent.com/cd/0/get/Ch_RAlldGok5eOpv1H6Lv5TpzwXvRQg1QTK_3g4amX2n0jJJTsn8rRC8Zsg9NFPWUrBAPpWDIDpp7mCLpP4Q4QqIrSZ37K4BxCJm8Eqe1joNCujUAzvBjovqTHD4mIOkLIoubpMMMosCHd-_tqKv5RTy/file
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.
uc9eee2e737507f6f9e733a2134f.dl.dropboxusercontent.com/cd/0/get/CiHaMDvEob-MmJkQSfZE6XX2dtOfs29PVgjAVpHddb5Fw6z1JEo9wx2B5f0DAoah2cesjQPszKzdJOdOLDUOOQWKUb1LcNPa7bs65s0O1rrvJ0fBeKeAzQBOlWPw_oVv8YU-5gAzpGXyL2iWAPpM5VnQ/file
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.
uc67f2b29d73fe3a732eab5753c6.dl.dropboxusercontent.com/cd/0/get/Ch_nJAnO7BPyTbYKqz1y53DXTWo4-93Fr0-uu44YIyVLIAIMK--T-qV4oTMZxOLIFXk_rQTZGpjd2DruYLx3Cr-YHBFs1aVcTMldLWbWodGDAHUNVI-EgfWoQ_u91D7kctNjYqCII3AYFAldlYHDd1Iw/file
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
Member since 15 Jun, 2009