ranma's Forum Posts

  • you have every x ms system expression, but also I'd recommend using instance variables for player (that's how I roll :)

    1) shoottimeout = interval in milliseconds

    2) readytoshootin = 0

    shoot button is pressed && readytoshootin <= 0

    -> create bullet

    -> set readytoshootin to shoottimeout

    readytoshootin > 0

    -> set readytoshootin = readytoshootin - dt

  • bump.

    the app in first post was created using phonegap export, tried the same with app mobi export, also doesn't work, even in appmobi xdk emulator.

  • actually if only you could send data FROM javascript TO the canvas somehow it would work and also it would help writing custom functions for phonegap / appmobi using their apis. right now you can call JS from canvas (callJS, geturl) but you cannot receive data from js. I'd be more than happy to see construct condition like "on javascript function called 'menuButtonClicked'" and then in the javascript outside of construct you could do for example:

    document.addEventListener("menubutton", cr.menuButtonClicked, false);

    and the above problem would be solved! :)

    also this would work with back button and search button, even volume buttons or other events, you could use geolocation in construct, just imagine C2 app with GPS! :)

  • For me actually it works great (was cheering for phonegap but appmobi just seem to work without any issues at all) and you can use appmobi api to do lots of fun things (vibrate for example) that are not iplemented in C2. So for me it's appmobi now.

  • i just noticed the system expression:

    choose(Value, Value)

    so in your case the supersimple answer is use it! :)

    choose(-20,500)

    have fun!

  • you need to make calljs load external js file which contains all your media:

    var sound1 = new Media(src);

    var sound2 = new Media(src);

    ... so on.

    and whenever you need to play sound, call javascript:

    sound1.play();

    this has some problems though, tested in on start of first layout, and for some reason calling just sound1.play() didn't work, but calling alert('play sound');sound1.play() worked.

    also this should really be implemented somehow automatically by construct export hopefully in some of the next releases right?

  • It would :) I believe you now know what to do to make it work for you though. Cheers

  • > I need to get a random number that is -20 OR 500, not a range

    > Thanks-20+floor(random(2))*500

  • I need to get a random number that is -20 OR 500, not a range

    Thanks-20+floor(random(0,2))*500

  • of course, that's why I said that it works, but if this was the way I wanted to work I wouldn't buy C2 now would I? :) I really hope this can be sorted out and working in a near future as a game without sound is no game. also I believe in scirra guys, I've been here since some really early versions of construct (classic) and seen things they can do, so no reason to stop doing them now, right? :)

    also I quite don't understand why this is not a first priority issue for now :) lack of audio on a mobile game is a HUGE problem. I understand that phonegap support is experimental, but if you can make audio work there with a little bit of hack, why it cannot be implemented into the C2. also I think, if phonegap support would be done in a way that more and more phonegap's features would be implemented, C2 would become a number one mobile game creation tool.

  • phonegap HAS an audio engine ( docs.phonegap.com/en/1.3.0/phonegap_media_media.md.html )

    which WORKS when called via javascript outside of C2 canvas (modifying the html C2 produces) so I believe it is C2's problem unfortunately :(

    edit: just exported by appmobi, the sound is there, it plays well, also multiple sounds work, but one particular (music that plays in background) doesn't. for now appmobi wins over phonegap :)

  • the basics are:

    <style type="text/css">
    element {attribute: value; attribute2: value;}
    otherelement {attribute: value;}
    moreelements, somethingelse {attribute: value}
    </style>
    

    based on that:

    <style type="text/css">
    
    html,body {
       margin:0;padding:0;border:0
    }
    
    canvas {
       border: 1px solid red;
    }
    
    body {
       background-image: url('iPhone.gif');
       background-repeat: no-repeat;
       background-attachment: fixed;
       background-position:center center;
    }
    </style>
    
  • I think Adobe actually own Phonegap.

    another reason to concentrate on it instead of appmobi :)

    and true, on appmobi I got sound to work, but still would prefer phonegap.

  • also add

    html,body {margin:0;padding:0;border:0}
    

    default margins / padding are set to be > 0 by default by the browser that's why it's off i think.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • and then there's this:

    stefankendall.com/2011/12/29/using-appmobi-stop-immediately

    also I remember Ashley's struggles with them

    and second also, major company like Adobe uses phonegap

    so in conclusion, I'd prefer phonegap export to be the final and working over appmobi as I like to listen to people smarter than me :)