nutmix's Forum Posts

  • Ive just realised that the official one doesnt have the fallbacks that socket.io has. i.e. socket.io will work with IE8&9 (i.e. work with people stuck with XP) via its flash socket fallback.

    Also, I cant get the oficial web socket plugin to work with socket.io running on node.js.   I can write a js page which works with it, but cant get C2 to work with it. It never connects, no errors, nothing gets sent or received.

  • Wow, thats great. I cant open the capx in the socket.io tutorial which requires the unofficial one (https://www.scirra.com/tutorials/571/modded-socketio/page-1) anyway, so perhaps Ill just go it alone with the official plugin.

  • Hi, there seem to be two plugins developed for socket.io:

    JohnnySheffilds: scirra.com/forum/plugin-zack0wack0s-socketio-mod_topic56503.html

    Zacks: scirra.com/forum/plugin-zack0wack0s-construct-2-plugins_topic43422.html

    Anyone know what the difference is between them, and which one is best to use to use web sockets to node.js?

  • I would like to ask if anyone has any kind of Bingo project they would be willing to share, to help a beginner start a bingo demo.

    Whats the best forum to ask for this kind of help?

    Many thanks!

  • Construct 2 is good at the core game canvas, but not so good at lobbies, login sessions, info screens, help screens etc.

    What I am wondering is this:

    1. Is it possible to "call" a URL/HTML Page from within the game, such that on that page, if they hit a "return to game" type HTML5 button, they can get back to the game (ideally the game will pause, but I guess that's not possible)

    2. If you imaging a lobby of game rooms, showing the number of players etc, I would do this using a server driven HTML5 page. I would then want to be able to click on a page, and launch the game. When the game is finished, it should go back to that page.

    Is there any way to do this kind of stuff?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I would like to whip up a quick bingo demo, to see how feasible it would be. The idea is to eventually hook it up using web sockets or socket.io to a server sending out the balls etc.

    Does anyone have bingo type demo of any sort by any chance that they might want to share? The biggest issues will probably be scaling an moving items around to fit the multitude of mobile devices (HTML5 only - apps are not wanted, unfortunately).

    If the company likes the game client (the server is the easy part), there may be work=money in it!

  • One of the main reasons I stopped using the otherwise excellent C2 because I could not reuse code between lots of similar games.

    Having tried stencyl, they achieve something like this by putting the code (using their drag and drop code editor) into a new behavior, then you can save this behavior (and its code) for use in other projects. I have not looked at how they handle the behavior codes interface, i.e. if you can instantiate he behavior (and its code) with parameters, make calls to sub functions/methods etc.

    Is this possible in C2? I cant see a way of creating a new behavior (or other object) which has code behind it, but can be exported. I had no luck trying to export/import event sheets, even if all the dependent objects were duplicated in the new project.

    Another main reason for not using C2 is that you cant fire your own events. Stencyl has this feature (I am informed by my team).

    The final reason for not using C2 is that creating dialogues, settings editing page etc. is a lot of work (for HTML5 mobile browser target at least) requiring all clickable objects to monitor some very hairy state code which got too complex to maintain. Stencyl allows you to set a layer to be active and layers below inactive, so the sprites in the layers below don't get click events.   I know in C2 you can put events in a group and disable groups, but this doesnt work for our complex games with a lot of sprite buttons on a lot of different layers/event sheets (required for a casino game).

    As an aside, Haxe seems a great language - dont know if its been considered for C2.

    I still prefer C2, if only it could offer "enterprise" features (i.e. code reuse, fire your own events, dialogue handling etc). Adding functions was a big step towards this.

  • I was struggling with the same issue for mobile. I was thinking of loading the background dynamically, and storing a ton of sizes and aspect rations on the server as images. If there is not an exact fit, I would either get a larger one and crop or scale down, or smaller and up.

    However, what I found was that although my game only displayed a few sprites at a time, there were so many outside the game (as you need to have sprites for every thing which can be touched or moved). The core game was fast, but when I added all the dumb info screens and their backgrounds, buttons, settings and all the stuff you need to put round the game, it was too slow and the code unattainable so abandoned the project even though the games themselves were complete (it was a suite of slot machines for real money for an existing online casino).

    However, I'm keeping my eye on construct 2's progress, hoping that one day it will have more support for native html 5 mobile, e.g. the ability to swipe in a settings form and a better solution for multiple screen sizes/ratios without black letterbox bars (which is currently possible, but extremely difficult when you add swipe navigation). When It does, the world we be at our feet.

  • Thanks for the replies. By Dialogues, I meant dialogue boxes for things like settings, info, rules, help etc.

    To implement swipe, you have to track x & y mouse coords, and have thresholds for dx dy etc. however, if they start/end the swipe over a button, then you get an unwanted button event also. Unless you manage all button type events yourself, which is pure pain.

    Other libs I have used have allowed more interaction with the surrounding OS, which for mobile would be the html5/css outside the canvas. I could not find a way to use this (e.g. use CSS transforms to swipe in info pages outside of the canvas, which was not designed to do this).

  • Hi, I created a couple of mobile games with C2 6 months ago, and stopped because of a few reasons (below). Has anything been added to help any of these three areas?

    1. non-trivial info/settings screens too hard to create - no support for dialogues etc. Almost as hard as the game itself, requiring a lot of sprites, events and event hacks (as much as the game itself)

    2. Difficult to handle swipe gesture on mobile, which breaks button handling. I.e. swipe in/out different configuration/info screens.

    3. No ability to create libraries or cut and paste code across projects, requires a lot of re-entering and maintaining of duplicate code.

    Great product other than this.

    Thanks!

  • I did a full feature slot game. Took me 2 weeks. Then I added swipe left/right to bring in settings and info screens, which could also be swiped up down. Took me more than 6 weeks. The result was a disaster of unmanageable code. I gave up with he project, although it was complete and 100 sexy, no way to maintain it, and it had a number of small swipe glitches (e.g. if you start swiping on a button, and finish swiping off a button, that cant count as a button press, so you have to manually manage all your own buttons - what a pain). I went the route of creating several layers, each with its own panel, then the game starts, I move them all off to the left and right just outside the visible area. The game handled different screen sizes, so this was variable. This is a very difficult way to go. If I had to do it again, I might try one big layout, with huge gaps between each "screen" filled with background to allow for different widths and heights of mobile devices. I also found that any kind of swiping ran at about 1fps on the iphone 3 and 3gs, and was not great on 4 (around 25fps). Looked fantastic on 4s and Ipad 3 though. Probably the biggest single most challenge to doing this is the fact that buttons get touch events even though they are hidden below other layers and even made visible. This requires some very quirky logic to figure out which buttons should be pressable during and after swipe events. This cannot be fixed with the enabling/disabling groups. I would advise against any form of swipe. Do it with buttons until C2 gets swipe support (which also works with pressing buttons) and the ability to make buttons disabled.

    I animated the swipe by pinning all the screens items to one object. Then I use the bullet behaviour on that. I had 4 invisible pixel object on each screen so I know if it had gone the right distance left/right/up/down. Then you have to move it back to exactly the right place as stopping a bullet leaves it in a random place.

  • I have seem some nice snake games posted, but the movement was only horizontal or vertical.

    Is there an easy way to "follow" an object, e.g. a snake body segment, to the segment before it (or the head). Then the app just needs to move the head. The pin behavior does not work in the required way, it would need something like a "follow" behavior to allow segment articulation.

    Also, how would one approach the head movement, assuming the head should turn towards the cursor or finger touch. It should not jump to face the finger, but slowly turn in that direction. Is there any way to do this without trigonometry & small incremental changes?

    Doing the Trig is straight forward enough, I was just wandering if there was any support for this time of movement built in.

    C2 doesn't seem to have any tweeting, only absolute movements.

    Thanks for any ideas or strategies.

  • Voted. The more people who buy construct 2, the more features can be developed.

  • To statically initialize a big constant array with several hundred values, is there a way other than writing your own json object (as I have done), or hundreds of set statements?

    Thanks!

  • I found this bug, and switched to using a bunch of ifs to handle the negative cases. Ill have to try your formula.