PixelRebirth's Recent Forum Activity

  • Let's say your game got a native width of 640 and height of 480 pixels.

    Now make an event that sets the layout scale to Browser.ExecJS("window.innerWidth")/640. In a subevent you should check if LayoutScale*480 is greater than Browser.ExecJS("window.innerHeight") and set the scale to Browser.ExecJS("window.innerHeight")/480 instead.

    This measure prevents parts of the layout from being cut off because there isn't enough vertical space available.

    Now you need to set the canvas size to 640*LayoutScale in width and 480*LayoutScale in height.

    The result should be basically the same as if you had letterbox fullscreen enabled. In preview it will add the border for non fullscreen projects that will mess it up a little.

    Of course now you can make an event that sets it to half that size easily or control it in any other way. This can also be useful if you licensed a game and you are asked to add dynamic resizing to your game as part of the API implementation.

  • If you want to resize your canvas at runtime it's better (in my experience of course)to not use any fullscreen mode, but turn it off and use your own events instead.

    Use some simple math to find the layout scale (window.innerWidth / native width and then check if the height still fits with that scale, if not base it on the height), set it, and then also set the canvas size accordingly right after that.

    Since Browser.ScreenWidth/Height returns the user's desktop resolution, I use Browser.ExecJS("window.innerWidth") and "window.innerHeight" instead, which gives the correct results.

  • Try to lower the deceleration of the platform behavior when the player is being hit and possibly also disable player input for the duration of the "fallback".

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The browser object has the actions "Go to URL" and "Open URL in new window".

  • Why don't you simply push the UIDs of the objects you want to group to an array? You could then iterate through them and call the necessary actions.

  • Revisiting this thread again, because I seem to have fixed my issues with the Chrome Web Store.

    What worked for me: remove the div element in which the canvas is enclosed in the index.html file. I know it says "The canvas must be inside a div called c2canvasdiv" in the file, but that doesn't appear to hold ground.

    Then change the canvas tag to look like the following:

    <canvas id="c2canvas" style="display: block; margin: 0px auto;">

    Projects that are exported with fullscreen off have some unnecessary space at the bottom of the canvas. This change gets rid of it.

    It also makes the canvas always be centered even if you resize it at runtime btw.

    I didn't test these changes exhaustively, but it does indeed work for my project. But do this at your own risk of course, keep backups.

    Another chrome web store related hint: if you make use of a plugin like Clay.io, which will communicate with an external server, you need to add an additional line to your manifest.

    "content_security_policy":"script-src 'self' 'unsafe-eval' clay.io https://clay.io:846; object-src 'self'",

    Of course the specified URLs are for the Clay.io plugin. Switch them with the ones you need.

  • You should probably have a look at the following thread and the examples Rojohound posted there:

    http://www.scirra.com/forum/follow-path-behavior_topic47235.html

  • I'm surprised that Bolosaur said letterbox integer scaling would solve the issue. It definitely doesn't for me. However activating pixel rounding did indeed fix it, but of course that results in jerky movement and scrolling. So it's not a viable solution.

    In any case I would regard this as a glitch, since the spritefont is showing parts of a character it isn't supposed to. Not sure if this can be helped or if it's just the way the spritefont is achieved that naturally results in this unwanted behavior.

    I assume arranging the characters differently in the spritesheet with empty space to the left and right might help. Or I will just have to go back for now to using a regular sprite and some events, which is easy enough. But definitely not as handy.

  • Hi PixelRebirth, can you explain me how you programmed?

    which means "Personaje move = -1, 0, 1, 2 or 3"

    thanks again

    The instance variable "move" defines in which direction the player sprite moves. A value of -1 means that there is no movement. 0 - 3 stand for the four directions you can move in. Multiplied by 90 it gets you a corresponding angle (0*90=0,1*90=90,2*90=180,3*90=270) which you then can use with the "Move at angle" action of the sprite.

  • There are numerous ways to achieve what you're asking for. It's a bit sad that the capx you posted didn't have any events, because it seems like you didn't even try. Always fiddle around, great things will happen. XD

    Here is an example for you:

    https://dl.dropboxusercontent.com/u/2306601/mario3move.capx

    It uses a few instance variables and a global variable to create a grid movement, which once moving will only stop when it's at the position of another level tile.

    Have a look at it, I hope it's helpful.

  • A basic version of such a mechanic could be implemented by simply giving enemies an instance variable that holds a descriptive function name. Like "firebreath" for example.

    Now when the enemy is sucked in and destroyed, a variable of the player sprite is set to "firebreath".

    And finally you have your action/attack event or whatever call a function with the name of that player variable. Which in this case is "firebreath" of course.

    This way you have a nice workflow and can simply create the appropriately named functions and have them do the stuff that needs to be done. :)

  • Yes, unfortunately there are problems with the chrome web store. I have struggled with it myself and also made a thread about it not long ago, which remained without reply.

    The one game I got running properly on the store isn't using fullscreen and I used the version you can download from clay.io through their distribute options, when you upload your game there. So that might be worth a try.

    I am always hoping for some fixes regarding the chrome web store exporter or at least some viable workarounds. <img src="smileys/smiley18.gif" border="0" align="middle">

PixelRebirth's avatar

PixelRebirth

Member since 26 Mar, 2008

Twitter
PixelRebirth has 1 followers

Trophy Case

  • 16-Year Club
  • Entrepreneur Sold something in the asset store
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Coach One of your tutorials has over 1,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

23/44
How to earn trophies