Arkanoid Mouse Limitation

For questions about using Classic.

Post » Wed Jul 10, 2013 10:51 am

I'm creating an arkanoid game. I need two functions:
- to stop a mouse moving
- to limitate it between two coordinates

I mean, not a sprite with mouse position, I need it for Mouse.

Something like:
M&K set mouse X to: clamp(mousex, 30, 650),
but this isnt work((

May its possible with Python?
B
5
S
2
G
5
Posts: 97
Reputation: 2,826

Post » Wed Jul 10, 2013 11:22 am

I found a plugin Input Sytem. It may to be a solution. I need this action:
On mouse axe X + : sprite set x position to .x+1
On mouse axe Y - : sprite set x position to .x-1

Anyone can creat a .cap for me?
B
5
S
2
G
5
Posts: 97
Reputation: 2,826

Post » Wed Jul 10, 2013 1:31 pm

I do it!
So I used objects Window and SysInfo.
For limitation i Used:
If m&k.absmousex < sysinfo.getscreenwidth-370 then m&k set mouse x to sysinfo.getscreenwidth-370;
If m&k.absmousex > sysinfo.getscreenwidth+250 then m&k set mouse x to sysinfo.getscreenwidth+250;
{250 and 370 its a number setted by me}

For stopping a mouse i used:
if global('stopped') = 1 then:
trigger one : global('mx') to m&k.absmousex
always : m&k set x to global('mx')
B
5
S
2
G
5
Posts: 97
Reputation: 2,826

Post » Wed Jul 10, 2013 6:49 pm

Thanks for sharing your solution!
"Construct 4 lets YOU make advanced games! (but not play them)" Construct Classic - Examples Kit
B
111
S
38
G
17
Posts: 2,175
Reputation: 19,045


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest