jayderyu's Recent Forum Activity

  • ok. Let's see I can express the problem properly here as there are more steps and strange behaviour involved.

    CAPX: dl.dropbox.com/u/14087254/DragAndDropBug.capx

    The design

    The sample uses a dual analog setup for testing purposes. The intention is that upon pressing the large circular area(pad). The DnDB object(stick) is moved to the touch position and then proceeds to have the DnDB object dragging condition.

    Problem

    The Drag and Drop Behaviour(DnDB)if placed into a folder for sorting will not achieve the desired above results. the behaviour object will be moved to the touch position, but will not be put into drag mode.

    Steps to produce

    Test A(working)

    run game

    put a finger on the either large circle.

    Move finger around.

    DnDB moves with finger as it is in "is dragging" state.

    Test B(not working)

    In the events. Put either stick1 or stick2 into the "PUT_STICK_IN_HERE_TO_BREAK" sub folder.

    run the game

    touch either large circle

    move finger around

    DnDB object does not move with finger as the object "is dragging" was not set. :(

    There are two results from this

    1. the object does not switch to dragging

    2. Even if there is only one DnDB object. No other DnD objects will work.

    I hope I expressed this correctly. I left two test cases inside to show that it doesn't matter which DnDB object is in a subfolder. As it does continue to affect others that are not.

    Chrome, FF, Opera

    Android Browser and Chrome, IOS Safari 5 and 6

  • CAPX: dl.dropbox.com/u/14087254/groupconstbug.capx

    Steps to produce

    Run the project

    The problem seems that a CONST variable in a group causes an error window. However the game will still run once "prevent further messages from this" is flagged. It can also be fixed by choosing "static & const" flags set to true.

    Opera, FF, Chrome all updated are the web browser.

    AMD quad core, ati 6800hd

    4gb system ram, 1gb gpu ram

  • As a programming FYI

    Reference to C

    technoburst.blogspot.ca/2011/07/difference-between-const-and-static-in.html

    and from Scirra manual

    scirra.com/manual/83/variables

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

    CONSTANT are variable that are initialized ONCE at the beginning. They are supposed to hold unchanging values.

    STATIC are variables that persist in a class or function between calls, but allow for the variable content to change.

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

    Since maxCarrots can change he should be setting the it's toggle to static not const. Will this fix your problem? no idea, but it's what you should be doing to your maxCarrots variable as you need it to persist and change.

    static = on

    const = off

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Touch(index)

    distance(touch(0).x, touch(0).y, touch(1).x, touch(1).y)

    I think this it... though you might want to use touch.XAt or touch.AbsoluteX

  • Based on playing the demo you provided I found the only annoying part to the sample is that when I run into a wall. The character will not move or slide along the even if my mouse has a lower or greater coordinate.

    This is what I think you want and what is happening?

    docs.google.com/drawings/d/1XBZR__-dh7mdBFvxNc7izP3io4S42lqCctBnNnDQcOE/edit

    one arrow is what is happening(is blocked based on linear direction)

    Where as the other area is the desired effect?

  • Well ok. Here are a few things I found out towards working on your solution.

    restart layout was resetting everything based around session storage. However, it did not reset Webstorage Local(ie long term). You might be able to get away with other methods by using another layout that has some vars or something, but I wanted to minimize any tampering to your own work.

    dl.dropbox.com/u/14087254/HNK_game.capx

    For now it uses local storage. Just remember when players do a fresh start to manually set the lives at the main menu before starting the game play.

    Hope you find it of some use.

    Thanks for the vote of confidence Space Ape, but I'm a noob at C2 :D. I just find the more I try to help the more I get my hands into quirks of C2 and become better at it over all :D

  • html on these devices have no way to lock the screen. It's not possible at this time. It sucks, but that's the way of it. I discovered this when writing my own webapp in code. So C2 won't give you a solution to this.

    However, that doesn't mean you might not be able to adjust. I haven't tried this in C2, but this is what you can try to do.

    on device orientation change to portrait

    rotate your the game layouts so that it's now back to portrait. however this has the catch that players will still see the rotation and the pop back when you change your layout angle.

    alternativly which is what I did

    on device orientation change to portrait

    put up a different screen and pause the app. Then inform the player that please rotate back to landscape.

    However, cacoonjs and appmobi may provide locking options. As I haven't done this bridging as of yet I have no idea if it's possible. but I think it would be.

  • can you please post a capx. this could be the result of numerous small things. some obvious some maybe not so much. so it would help to see what is happening.

  • First I suggest start reading some tutorials rather than jumping right in. My first project was doing the ghost shooter basic tutorial. That helped me understand how to put together C2 games. I then read the manual on the components.

    However to answer your question.

    * Assign your sprite the "Custom Movement" behaviour

    * Add the Keyboard plugin(or mouse if you want to use that)

    * Create an Event to watch for the spacebar

    -> Keyboard Space is down(action : sprite accelrate at angle(20 force, -90 angle)

    * create and ELSE event to the spacebar

    -> ELSE( action: sprite accelerate at angle 30 force, 90

    fine tune the up and down controls.

    and now your done.

    I strongly suggest learning by following the instruction of a few tutorials. the bird flight controls are super simple using C2.

  • CrudeMik could you send a stripped down version of capx that just focuses on the part you want working. I wouldn't mind trying to give this a shot. I want to make my game on the Ouya eventually and might come across a similar problem.

    Also if you need to figure out 360 degree in C2

    to 360: if(angle < 0) angle =+ 180

    to C2: angle =- 180

  • dl.dropbox.com/u/14087254/lineardragsprite.capx

    Here you go. I did this for another thread that wanted the same thing. There are 3 samples for moving an object within a limited range.

    Left is easy and acrurate enough I think for most slide switches

    middle is finicky but in there just to show how to use the touch for it

    Right uses the drag and drop and moves the object between two points

    also the capx was written for Y angle, so make adjustements as needed.

  • I think reading the purpose of the tutorial would help, however I also linked a capx that will serve your purpose for linear sliding of a touch event. the linking of the tutorial was only for checking out how to do drag and drop object to effect another sprite. not to literally copy command for command :D

    However, I thought of an easiest way to do only up and down sliding. I updated the capx.

    here is the link to the capx samples directly relating to what you want

    dl.dropbox.com/u/14087254/lineardragsprite.capx

    there are 3 models.

    Left: uses ontouch background object

    middle: drag and drop the slider box

    right: drag and drop a drag box that effects the moving sprite.

    choose one that serves you best :)

jayderyu's avatar

jayderyu

Member since 11 Apr, 2012

Twitter
jayderyu has 1 followers

Connect with jayderyu

Trophy Case

  • 12-Year Club
  • Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

16/44
How to earn trophies