Ugotsta's Recent Forum Activity

  • How about this? I created XY position variables (gameFieldX and gameFieldY) in the Sprite2 object. I then assigned these values during the array's foreach creation.

    The Sprite's able to access the array then by gameField.At(Sprite.gameFieldX and Sprite.gameFieldY).

    GridField.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • kittiewan, excellent example and you're totally right, surprisingly few events. I just noticed your response as I was working on the update I just posted above. Must've been working through this right as you were.

  • Pardon my dullness! I just realized how the Canvas plugin's Arc action works and used it to draw the shaded portion of the clock as needed. You'll likely want to make the clock image transparent on the inside so the tick marks show through.

    I just updated the file. Here's another link to it. :)

    canvas-plugin-analog-clock.capx

  • Both the Canvas plugin and SVG Canvas plugin provide ways to utilize vector graphics in Construct 2 currently.

    While I love vector graphics and would love to see inbuilt support for them in C2, I agree with Bob Thulfram that they're just not as popular as sprites, so I'm doubtful that'll be integrated anytime soon.

    I'm more keen to see further advancement of the SVG Canvas plugin myself. I'd like to see it have more Sprite-like features, like overlap detection and resizing/rotating. I'll have to ask Pode more about that in his plugin thread. :)

    Just to make it clear too, Pode's SVG Canvas can be used to animate SVG's as well. While it's not quite the drag and drop operation of Flash's timeline, it can be done.

    Here's a quick example showing text moving on an animated curve.

    svgcanvas-text-on-an-animated-curve.capx

  • I believe you'll want to use the 8-direction movement. You'll need to figure out how you want to constrain movement, to keep the player in your desired bounds.

    Possibly what you can do is use invisible sprites and upon collision, the player can't move further in a particular direction.

  • Likely, you'll want to use a global variable to maintain the time between layouts. You can simply increment that as needed.

    You could then display it via a Text object on your layer of choice.

  • I think you could also use the Canvas plugin to manually draw it.

    EDIT: This is definitely possible using the Canvas plugin. The following, while still needing a lot of work (I'm rather weak at math), demonstrates how it could be done.

    canvas-plugin-analog-clock.capx

  • You can adjust the x coordinate of the object in the dragging condition as shown in the following:

    vertical-drag-and-drop.capx

  • I may have misunderstood this a bit, but it sounds like you just need to add a tag to your particular sound. Then you'll be able to address just that particular sound by referencing that tag.

    Have you tried that?

    Basically, you add a tag, like "gun". Then when you use the Stop action, you enter "gun" for the tag of the sound to stop.

  • Oh, very nice! Your example is so much simpler than my own. I guess there's really no need to calculate distance and angle.

    Thanks for posting that! :)

  • Beany, I've not used Illustrator in a great many years so I'm not sure about SVG exporting with it, but as far as I've seen, this plugin has been able to render any standards-based SVG.

    What that means is that you can export to SVG format from Illustrator (assuming it's possible), then copy-paste the entire file into a variable in Construct 2. It's a bit of a stretch since the file-size would likely be enormous, but I believe that would be possible.

    As a brief example, here's a .capx file containing a butterfly rendering from some SVG code attained here.

    SVG Canvas butterfly example: svg-canvas-butterfly.capx

    I should mention, copy-pasting massive strings like that takes a bit of work. Construct 2 will only accept pasted strings that have newlines removed. I ran that butterfly SVG code through a search-replace in Notepad++ before pasting it into the project.

    It takes a bit of work, but this is more of a proof of concept than anything.

  • I just came across this thread and realized, I've got a project I just did this through. I'll post a linkt here as an example and explain the method I used.

    Check it out here: Inform 7 Map Builder

    You can middle-click and drag the canvas around in that example.

    What I did was created a Sprite object and added the ScrollTo behavior to it. I then checked for a middle mouse button down condition, at which point I stored the Mouse.X and Mouse.Y coordinates in the Sprite object's ScrollXMouse and ScrollYMouse variables and set the global variable "Mode" to "Scroll".

    With the Mode set to "Scroll", any further mouse movements will move the Cursor object from the original middle-mouse button down position, to the new mouse coordinates. This emulates the canvas scrolling effect.

    It's done by calculating the distance and angle from the original pressed mouse position to the new mouse position, as shown in the following screenshot from my project file:

    <img src="http://dl.dropbox.com/u/41325628/construct2/mouse-scrolling-canvas/mouse-scroll-canvas.png" border="0">

    Hope that helps explain how I achieved it. Perhaps others have better ways of doing it as well.

    I should also note, the url I gave above is a total work in progress and has not yet been properly released. It's top secret. ;)

    Cheers!

    -DavidM

Ugotsta's avatar

Ugotsta

Member since 9 Sep, 2011

None one is following Ugotsta yet!

Connect with Ugotsta

Trophy Case

  • 13-Year Club
  • Email Verified

Progress

14/44
How to earn trophies