Spinning a scaling ring

Get help using Construct 2

Post » Tue Nov 12, 2013 8:29 pm

I currently have a project that is creating and scaling concentric rings so they look like they are moving out towards the edge of the screen:

Viewable on the web: http://bit.ly/1anBGNs
Capx download: http://bit.ly/17mCChN

Where would I need to start to be able to spin these rings individually with a mouse? (eventually with a finger, but I'm not there yet)... They are each a simple png with alpha transparency.

Also, an acceptable answer is: "hey pal, you're fundamentally doing this the wrong way."moiremusic2013-11-12 20:31:34
B
4
Posts: 25
Reputation: 302

Post » Tue Nov 12, 2013 9:28 pm



Your app gets very poor performance though, you maybe implement a 128x128, 256x256 and 512x512-version of your rings on extra frames. Then for each ring check size.
If above 128x128 -> set to frame of the 256x256 variant
if above 256x256 -> set to frame of 512x512 variant
if above 512x512 -> set to frame of 2048x2048 variant
(note: i am not sure it will improve performance, but think it would)mindfaQ2013-11-12 21:29:33
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 788
Reputation: 3,788

Post » Tue Nov 12, 2013 9:42 pm

Thanks, mindfaQ. I'll start digging into this.

Yeah, I knew performance would be an issue. I was just prototyping for now. Your idea of sort of manually mipmapping these sprites might work well, though.moiremusic2013-11-12 22:16:11
B
4
Posts: 25
Reputation: 302

Post » Tue Nov 12, 2013 10:44 pm

Just a bit lost here... what type of variable is pickedinstance and what object is it a variable of?
B
4
Posts: 25
Reputation: 302

Post » Tue Nov 12, 2013 10:48 pm

global variable, number, used to identify the ring you clicked by saving the rings UID into the variable, so that we can set it to rotating = 0 when the touch input ends
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 788
Reputation: 3,788

Post » Tue Nov 12, 2013 11:23 pm

I've set up the events like they are in your image... rotating and fixedangle are instance variables of the Rings family, and pickedinstance is a global variable. Still something is wrong though. No spinning. Will have to jump back into it later tonight. If you want to take a look:

http://bit.ly/1e2bwRZ

Edit: one thought... the Touch events aren't limited to touchscreen inputs, are they? Because I'm just testing with a mouse with a non touch-screen monitor in a browser.moiremusic2013-11-12 23:31:45
B
4
Posts: 25
Reputation: 302

Post » Tue Nov 12, 2013 11:32 pm

System - Pick Rings where rings.rotating = 1 is a subevent of the touch-event in your version; it should be an own event

edit: you might need to add some more points to your collision polygon to make the selection work bettermindfaQ2013-11-12 23:34:25
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 788
Reputation: 3,788

Post » Wed Nov 13, 2013 1:59 am

Wow, good catch. This is great!
B
4
Posts: 25
Reputation: 302


Return to How do I....?

Who is online

Users browsing this forum: KTML5 and 24 guests