AllanR's Recent Forum Activity

  • Rise 0f BETA

    that code only changes the camera's x coordinate, so to move diagonally, you will have to also change the y coordinate.

    There are plugins that can help do it - like LiteTween, or MoveTo. Or you can do it with Lerp, or just calculate how much to add to the y coordinate each step of the way.

    In your graph you are moving 7 units on the x axis, and only 2 on the y. So each time you change x, you want to change y by 2/7 as much.

    Edit: yeah, what oosyrag said!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I use groups and functions extensively. And I like my code to condense down to nothing. Any code I am not actively working on gets minimized. And if I am not using any of the functions in a group, the whole group gets minimized. The current project I am working on has 1374 events on the main eventsheet (and growing), but when I load the project, it fits on one screen. I arrange the functions in a group alphabetically, and I always start code for functions from a blank sub-event (so that when the function is minimized all you see is the function name. The first line in the function is a comment that lists the parameters to pass in. With a couple clicks I can expand exactly what I need to see - its very quick and easy to find things, and everything else is hidden. Groups are divided up by what they do: Touch, Mouse, Keyboard, Player, Enemy, etc... but they are mostly general purpose routines, rather than for specific states. I will normally have a global variable that determines the state and that controls what code runs.

    I hate having unnecessary code running. If nothing is happening on screen, then cpu utilization better be pretty close to zero. Only do what's needed - when it is needed!

  • Unconnected

    If you mean make another instance (with same name, variables, etc) then, you can hold down the CTRL key on the keyboard, and then click on a sprite/object and hold the mouse button down and drag an new instance of the object to a new location.

    Another way is to right-click on an object, choose copy, then paste a new instance.

    Right-clicking and choosing Clone object makes a separate object (new name, but same variables, animations, etc - as you know)

    If you mean a new object (with a new name) that looks the same, but not with the instance variables and animations, then you have to start from scratch.

  • You can also use "Self" inexpressions, which is like using a for each loop.

  • jobel

    If you have a web site to post to, you don't need any of the above. You just export to HTML, uplaod to your site, and run the C2 app in safari, and then choose to "Add to home screen", then it can be launched from an icon and works exactly as if it was wrapped - without the fees and hassle.

  • IJCT

    I like to use a sprite (called "Camera") that has the scrollto behavior. Then you can control how that object moves in relation to the player - have it over the player, or to his left if he is moving left so you see more of the direction you are going (and vice versa). You can limit its vertical movement while allowing the player to go up and down short distances without scrolling the whole screen unnecessarily...

  • I would be interested in hearing what people do as well...

    I have read that the official C2 steam plugin needs updating and that there is one in the store that works well for adding achievements, steam overlay, etc.

    I have also heard there have been issues with reviewers capturing game play, and that non Windows platforms may have issues

    but I don't know if those are old issues, or what versions work better than others, or what work-arounds people have tried.

  • MegaAntMan1

    I tried and played to level 3. The game finished loading without any error or getting stuck - so that tells me the assets must have loaded.

    these are the errors I get in the console when the game starts: (sounds like there is a problem where you set the size of the objects - and it is coming out non-numeric or something...)

    WebGL: INVALID_VALUE: texImage2D: width or height out of range

    GLWrap_.loadTexture c2runtime.js:3231

    (index):111 Failed to register service worker: DOMException: Only secure origins are allowed (see: https://goo.gl/Y0ZkNV).

    OnRegisterSWError (index):111

    117(index):1 [.Offscreen-For-WebGL-000001FB7FD0B350]RENDER WARNING: texture bound to texture unit 0 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering.

    2c2runtime.js:3231 WebGL: INVALID_VALUE: texImage2D: width or height out of range

    GLWrap_.loadTexture c2runtime.js:3231

    4(index):1 [.Offscreen-For-WebGL-000001FB7FD0B350]RENDER WARNING: texture bound to texture unit 0 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering.

    WebGL: INVALID_VALUE: texImage2D: width or height out of range

    130(index):1 [.Offscreen-For-WebGL-000001FB7FD0B350]RENDER WARNING: texture bound to texture unit 0 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering.

    (index):1 WebGL: too many errors, no more errors will be reported to the console for this context.

  • ome6a1717

    I have heard of people using C2 for making a web site (and have seen a couple examples), but it is really not suited for that job. There is no way for search engines to index the content - so people will never find you by searching. It is much more complicated to make it responsive (adapt to screen size and orientation). If you want a scroll bar, you have to make your own, loads slower (because of the engine overhead), and other issues.

    I use C2 to make apps that are launched from a web site (and interact with a database) - but they are for private use, not available to the general public, so SEO is not a concern.

    It is possible to make use of the whole screen (and center things), have a (custom) scroll bar, and make a nice looking interface... just not ideal for a typical web site.

  • the Mnk

    what 99Instances2Go said is correct - C2 does not update its internal indexes/counts until the next top level event after the create object action.

    You can continue to access the object in sub events under the one that created it, and you can pass its UID to a funtion that can pick it by UID.

    Another thing you can do is add a wait 0 to give C2 a chance to update before running actions after the wait.

  • Annilou

    at start of layout you are changing the value of the global variable, but since there are probably multiple buttons, it is getting a value other than what you are looking for.

    if you move that action to event 2, it should work. (set the global variable button to button.action in the "On Left button Clicked" event, then the sub event will work - when you click on the button that has "action" set to selectCharacter)

    another way to do it without a global variable would be to store the layout to go to in the "action" instance variable, (set button.action to "pjCreation")

    then in event 2 add an action that says: system > Go to button.action

    (then you dont need the sub event, or other sub events for other layouts).

  • Turaco

    I recently was working on doing something very similar - although I was also trying to use the entire screen (regardless of device size or orientation) by using Scale Outer and Unbounded scrolling (which added an extra level of complexity that took me an entire long weekend to work out).

    it is just a matter of calculating how far the layout is allowed to scroll, and keeping within those limits.

    So, here is how I would do what you were asking - no plugins required:

    http://www.rieperts.com/games/forum/ScrollLimit.capx

    this version does the double tap to zoom you mentioned, but I also included how I track multiple touch points, and do pinch to zoom... I also added a button to turn the limit feature on and off so that you can see that it really works.

AllanR's avatar

AllanR

Member since 21 Nov, 2013

Twitter
AllanR has 23 followers

Trophy Case

  • 10-Year Club
  • 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
  • Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

19/44
How to earn trophies