You do not have permission to view this post
Maybe you could use clamp for that.
clamp(x, lower, upper)
Return lower if x is less than lower, upper if x is greater than upper, else return x.
Develop games in your browser. Powerful, performant & highly capable.
add variables xpos and ypos to the object.
When You create the object at random position. Set the Xpos and Ypos to object.x and object.y.
Then every tick set position to:
x = self.xpos + cos(tickcount)*radius
y = self.ypos + sin(tickcount)*radius
Like this?
Variables:
xpos = 100
ypos = 100
radius = 100
Every tick:
set position:
x = xpos + cos(tickcount)* radius
y = ypos + sin(tickcount)* radius
Have you added mouse object to the project? If not, double click on layout and add mouse to the project.
Does this work with C3 runtime?
a small progress gif. The spectators are designed by my 4 and 6 years old daughters :)
angelo Thank you for the compliment. For some reason, the gif was somehow messed up, so the speed is super fast. But I found it funny, so I let it be :) The camera zoom isn't really that intensive, it's actually quite subtle.
This is from my upcoming mobile racing game: CasuRally.
Won't run in C3 runtime:
[quote:2rvhdhog]The runtime of this project cannot be changed to the Construct 3 runtime due to the following reasons:
Plugin NW.js (NodeWebkit) is not supported in C3 runtime
If I remove the nw.js, it's only black screen...
I got it working. The problem was that I was setting both x and y with different random numbers.
I fix it by using a local variable instead of generating a random number in the equation...
Member since 28 Dec, 2007