jayderyu's Forum Posts

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

  • oops. that's right. be sure to flag it once it executes :D

  • Actually thinking about it while walking my son to school I had another thought.

    If your using the controls for some kind of main menu or options(ie volume control). Then you don't need to prepare for multi touch input. Instead you can make it a little easier.

    Here is a sample of all 3 ways I suggested.

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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yeah. I found using the Drag and Drop behaviour works poorly when your trying to use it with setPosition() when limiting area.

    I have a thought on how you can do this

    Don't Drag and Drop your slider icon.

    Create an invisible drag and drop object over your up/down slider sprite.

    set Y position of your slider to the Y of your Drag Box.

    This will limit your slider sprite to the Y axis.

    You will also need to check for Y minimum and maximum ranges. You can do this with a heavy inline if statement or 2 extra sub events.

    slider.y = ( (drag.y < min) || (drag.y > max) ? (drag.y < min ? min : max) : drag.y )

    don't forget to reset your drag box on drop :)

    here is a tutorial. Overkill for you needs but you never know what helpful information you can find.

    scirra.com/tutorials/398/touch-stick-controllers/page-1

    Now if there is a way to limit an particular objects axis. That would be cool, but I have no idea if that exists. Still a noob here :D

  • Well if your using the beta for C2 then

    --onTouch of Object

    -> call foo function

    --on some other condition

    -> call foo function

    --foo function

    -> do stuff

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

    If your using the last stable build

    var action = 0

    --onTouch of Object

    -> action = 1

    --on some other condition

    -> action = 1

    --condition: compare action = 1

    -> do stuff

    Personally I like functions. They make like easier and they are less condition checks in the main loop :)

  • I would like to see this sample too please :)

  • That won't work or at least doesn't for me. C2 has/had a clause in 108.2 that if the game is not being properly viewed from a webserver. The game will just give an warning error.

    "Exported games won't work until you upload them"

    I got myself a portable webserver(mowes) to handle this.

    The other alternative is to put the game onto a webserver and ready it with the offline.appcache. Go to the game with your portable browser and make sure the cache is set to your flash drive and hope for the best :D

  • That's right. The level rotated a lot with your character. :D

  • I'm jaw dropping on this project. For 100 events I think this game is amazing. Personally I think metroidvania this game up a bit. Maybe do a small kickstarted project to let you get more time to work on it. Then sell this bad boy on various devices :D

    I still find the controls difficult. Mostly in that I find having my "jump" button on the left side to be unintuitive. I think this is far more me though than the game :D I would like it if I could swap Z and C around.

  • I've had a thought about creating a large game world. What I am wondering is about the performance of handling position that way. Instead of moving player by X/Y. Instead object(containing large sums of pinned objects) is moved. If player turns right, world rotates left?

    Would this have a significant effect on performance.

    Also what kind of impact would designing the game around this model and such difficulties

    finally would there be a problem with translating physics if wanting to use vehicles or other such things.

    Now of course the only reason I would want to move the word. Would be that I can load and unload sections of the world at a time for very large worlds. I'm not working on a game like this yet and am unsure if I will ever get there, but I am wondering about the design and the how it would be done.