jayderyu's Forum Posts

  • I have personally found that comparing same family/instance objects takes a little more work.

    Every object has a UID(Unique ID related to all objects in the game) and an IID(instance ID related to those of the same object).

    You will need either of those values(not both). At this point however I don't know how your game works. So I am only going to give you a relation as if your hex game was similar to a memory match style game.

    Memory match is about choosing 2 "cards". So let's go with that.

    var selected = 0

    var iidHex = -1

    var compare = ""

    ------------

    cnd: Touch on touched Hex

    ->sub event-cnd: selcted = 0

    ->action: iid = Hex.iid

    ->action:selected = 1

    ->sub event-cnd: selcted = 1

    ->action: compare = hex.variable

    ->sub event pick Nth instance of Hex

    ->action: compare two values(compare, Hex.variable)

    Now I'm sure a master can do this better, but this is the idea your going for.

  • Others will appreciate a capx of your project or at least the relevant parts in an image.

  • I haven't developed far enough, but Arima's point 1 is super important. When dealing with any long term touch your far better off using a sprite. Even at 1x1.

    Sprite with Drag and Drop behaviour.(don't put this D&D into a folder for sorting)

    On Touch -> dragbox set position to touch.x touch.y

    if your only doing a button then no worries.

    Anyways that's my experience :

  • Well here are some suggestions.

    A.

    1. Store Touch.X/Y when originally pressed.

    2. On release compare distance and angle of start and end.

    B

    1. while in touch

    2. every 10ms(choose your own time for repsonse) store X/Y

    2. on the 10ms compare distance and angle. then store new X/Y coord.

    in either method do what you want with angle and distance :)

  • While I understand from a developer and technical view. It still exlcudes the easy use of the plethora of shared pallets. Also having to put in 12 digits for translated numbers is a pain.

  • Oh wow this is awesome. Thanks for the thread and thanks for the link to the the physics version. I wanted to throw a spinning wheel or some slot machine in my game and now I'm all set and know that the wheel is the wheel to go.

  • You shouldn't need to use PHP for server side scripting. As long as your C2 AJAX call is a valid URL you should be fine.

    scirra.com/manual/107/ajax

  • Nope, NM. It's not working again. I have no idea what determines the success of the colour change or not :|

    I give up. It's working again. I'm not going to touch another thing in regards to the colour situation.

  • I've been trying to use this today, but have had some problems.

    -This isn't working for-

    Chrome 23.0.1271.95 m

    FireFox 17.1

    -Works in-

    Opera 12.11

    Android stock browser

    Android Chrome

    IOS 5.? safari

    What i'm trying to do is change a default colour(200,200,50) to (r,g,b, 45)

    I want to implement custom colouring on a basic body sprite. For chrome and firefox it's not working, but for works for the others I listed. So not sure what I'm doing wrong.

    Played with the sample 2.0 back on page 1 and it works. So there must be something that I should be doing on chrome and ff. I will look into it some more.

    Ok, found a solution. I'm not sure why it works in Opera desktop and FF, Chrome not so. However the fix was that I needed to "save current image" first. Now it works fine.

    BYW this is an AWESOME program.

    However is it possible to add the feature so that we can do

    Change RGB to Transparency. This would also be a nice feature for doing in game stencil creation.

  • Well opacity works well for the entire sprite as a whole. If a specific colour needs to be targeted C2 doesn't have native support for such an action. Though I think it would be helpful. However we are fortunate to have such a large number of talented js coders :)

    You can check out these to see if they are helpful.

    scirra.com/forum/behavior-sprite-effects-inject-text-on-sprite_topic51516_page1.html

    scirra.com/forum/plugin-canvas_topic46006.html

  • nice. very classic shooter'ish.... i always sucked at them :D

    I'm also very jealous. I'm working on a dragon game, but.. well...art.

    Being a non artist, I have my daughter doing the art design with scans. She's not a proffesional and it's clear. But it's a project we are working on together :D

    Anyways it's great :D keep it up

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Also another option.

    Create HUD like layer called SHOP. The layer is hidden by default.

    When the player opens the shop.

    Set timescale to 0 to pause the game.

    Show layer "SHOP"

    on close of shop

    hide layer "SHOP"

    timescale 1

    There might be some trouble with it, but it saves effort in regards to enemy positions and states.... if you go with the prior poster. There is a plugin called Spritebank. Which I think will do what you want.

  • Hmm. I would suggest looking into internal graphics work. Canvas plugin obviously also a way to copy and inject/paste the graphics. Also have a empty sprite with physics.

    What you would need to do.

    1. Create Physics Sprite

    2. Paint physics sprite with image

    3. On Cut Condition

    • determine angle of cut and point of cut
    • create two physics sprites based on the larger size.
    • paint two new sprites with by copying the 2 sections(includes the overlap angel.
    • use some trig to determine which part of the 2 new sprites need to be set to transparent. Looking up some canvas features. something like fillpath might work.

    4. show 2 new sprites and remove old sprite

    Now here is the thing. I haven't done anything like this, but I know plugins like canvas give you the ability to alter the image base. This is a requirement and only way to do it. good luck.

    Here is a sample image of what I think you want to do.

    docs.google.com/drawings/d/1X5Ai_mFPNjT1bDcLquGqTmU6wnmG9q5Y18YFfuHmANI/edit

    This way you can make the graphics changes nessisary and then cut them into to new sprites. Good luck :)

  • This isn't so much of an issue, but a question.

    If I end up writing more tutorials can I hand type the reference link to an image. I would prefer to do this rather than "upload" an image. That way if I end up improving a tutorial and change some images. i won't be using up SCIRRA's own hard drives.

    Just a little while ago(1hour) I started updating the touch controller tutorial I put up a month ago. I replaced every image. Now I'm concerned that the old images(and a couple images uploaded more than once) are just going to go to waste.

  • I don't believe there is an easy way to do so. I believe you could use ajax, and then parse the page return for images urls.

    But I really couldn't say for sure past the vague idea on how. I'm sure someone will chime in with some more details soon.