Prominent's Recent Forum Activity

  • Here Macbee ,

    Use the browser plugin and run a javascript event at start of layout with the following code:

    Make sure to replace the 320 and 180 values throughout the code with the desired sizes..

    It will stretch the screen.

    "
    var w,h;
           if(window.innerWidth>window.innerHeight){
                var aspect = 320/180;
                w = Math.round(Math.max(180,180*Math.floor(window.innerHeight/180))*aspect);
                h = Math.max(180,180*Math.floor(window.innerHeight/180));
           }else{
                var aspect = 180/320;
                w = Math.max(320,320*Math.floor(window.innerWidth/320));
                h = Math.round(Math.max(320,320*Math.floor(window.innerWidth/320))*aspect);
           }
           c2canvas.style.width= w+'px';
           c2canvas.style.height= h+'px';
           var c2div = document.getElementById('c2canvasdiv');
           c2div.style.width= w+'px';
           c2div.style.height= h+'px';
           c2div.style.marginLeft= Math.round((window.innerWidth-w)*0.5)+'px';
           c2div.style.marginTop= Math.round((window.innerHeight-h)*0.5)+'px';
    
    if(window.attachEvent) {
        window.attachEvent('onresize', function() {
           var w,h;
           if(window.innerWidth>window.innerHeight){
                var aspect = 320/180;
                w = Math.round(Math.max(180,180*Math.floor(window.innerHeight/180))*aspect);
                h = Math.max(180,180*Math.floor(window.innerHeight/180));
           }else{
                var aspect = 180/320;
                w = Math.max(320,320*Math.floor(window.innerWidth/320));
                h = Math.round(Math.max(320,320*Math.floor(window.innerWidth/320))*aspect);
           }
           c2canvas.style.width= w+'px';
           c2canvas.style.height= h+'px';
           var c2div = document.getElementById('c2canvasdiv');
           c2div.style.width= w+'px';
           c2div.style.height= h+'px';
           c2div.style.marginLeft= Math.round((window.innerWidth-w)*0.5)+'px';
           c2div.style.marginTop= Math.round((window.innerHeight-h)*0.5)+'px';
        });
    }
    else if(window.addEventListener) {
        window.addEventListener('resize', function() {
           var w,h;
           if(window.innerWidth>window.innerHeight){
                var aspect = 320/180;
                w = Math.round(Math.max(180,180*Math.floor(window.innerHeight/180))*aspect);
                h = Math.max(180,180*Math.floor(window.innerHeight/180));
           }else{
                var aspect = 180/320;
                w = Math.max(320,320*Math.floor(window.innerWidth/320));
                h = Math.round(Math.max(320,320*Math.floor(window.innerWidth/320))*aspect);
           }
           c2canvas.style.width= w+'px';
           c2canvas.style.height= h+'px';
           var c2div = document.getElementById('c2canvasdiv');
           c2div.style.width= w+'px';
           c2div.style.height= h+'px';
           c2div.style.marginLeft= Math.round((window.innerWidth-w)*0.5)+'px';
           c2div.style.marginTop= Math.round((window.innerHeight-h)*0.5)+'px';
        }, true);
    }
    else {
        //The browser does not support Javascript event binding
    }
    "
    [/code:jvv3wckq]
  • You could test it yourself..

    One will be set before the other, so if you put something like

    on X pressed

    spawn projectile at layer 1 point 0

    if var2=0 then projectile set instance var1 to 1

    on projectile created

    if var1=0 then projectile set instance var2 to 1

    So whichever event gets run will show you which is set first. You'd use the debugger to check the values.

  • The bullet behavior and the physics behavior don't influence each other as far as I know.

    You'd have to create an event that tests if the sprite has collided with the wall, and set the velocities to 0 accordingly. You may even have to push the sprite back out of the wall. I know the custom movement behavior has events to push out of solid objects.

  • Look into using Families. If you have objects in the same family, you can use events on the family to affect all the objects in that family.

    Also look into for each loop, to loop through all the objects and apply events to all of them.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • one stupid workaround I use is to load/import a blank tmx map data. But yea, I don't know how to do it any other way, which is annoying.

  • I think you'd have to have some server-side script such as php write to a file. So you don't need mysql, but you'd use something like php. Look into ajax and xmlhttprequest

  • Oh okay. Yeah, the tilemap has editor stuff for placing the tiles, etc.. I might not need that stuff- I'll try to see if I can remove that.

  • excellent! thank you. Somehow I overlooked it in the plugin/behavior list.

  • I don't quite understand. I'm wondering how to duplicate a tilemap plugin. You said that it uses features other than the layout? So I need to figure out how to remove those.

  • Is there a way to discern what features the tilemap plugin is using so that I can remove the non-layout ones?

  • yea, even without the other modifications, if you just change the IDs, it still crashes. I tried it again duplicating the original and only changing the ids just to make sure, and still crashed.

  • I'm looking for a plugin/behavior that will display a portion of an image. Could be for a sprite or background, etc..

    So like if I have a spritesheet, I could just display one area of it.

    I thought there was a plugin for this somewhere, but I can't find it.. anyone know where it is?

    needs to work both webgl and canvas2d

Prominent's avatar

Prominent

Member since 28 Apr, 2012

Twitter
Prominent has 9 followers

Trophy Case

  • 12-Year Club
  • Popular Game One of your games has over 1,000 players
  • Famous Game One of your games has over 10,000 players
  • Email Verified

Progress

15/44
How to earn trophies