Spinning a scaling ring

0 favourites
  • 8 posts
From the Asset Store
****** Animated rotating torpedo game asset ********
  • 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: bit.ly/1anBGNs

    Capx download: 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."

  • <img src="http://i.imgur.com/5f9H1eH.png" border="0" />

    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)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • Just a bit lost here... what type of variable is pickedinstance and what object is it a variable of?

  • 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

  • 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:

    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.

  • 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 better

  • Wow, good catch. This is great!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)