mikehive's Forum Posts

  • There are several different ways of doing this. For your purposes, the simplest way might just be to do an extra check after spawning to see if any player objects are overlapping, and if they are, to reassign them to a new square. You'll want to do this in a While loop to ensure you don't randomly put them into a different occupied cell. (This isn't a great idea if you have a very large number of player sprites, but for just 3, this should work just fine).

    Eg. On start of layout:

    -------Spawn Player 1 at random coordinates

    -------Spawn Player 2 at random coords

    -------Spawn Player 3 at random coords

    --------------WHILE Player 1 is overlapping Player 2 OR Player 3

    ---------------------Set Player 1 position to random coords

    --------------WHILE Player 2 is overlapping Player 1 OR Player 3

    ---------------------Set Player 2 position to random coords

  • Looks great! Glad you got it working :D

  • One thing I've done in the past is to use an invisible helper sprite with Image Points laid out in the formation(s) I need. Then you can just place that helper sprite where you want the enemy formation to spawn, and spawn a baddie at each one of the Image Points.

  • It doesn't have to be that complicated. All you need to do is randomly pick one of the 3 values to be a low range. You can do it with one event :)

    Why not set color to:

    choose(rgbEx(random(0,25),random(75,100),random(75,100)),rgbEx(random(75,100),random(0,25),random(75,100)),rgbEx(random(75,100),random(75,100),random(0,25)))

    I've tested this and I think it works pretty well :)

  • You can use spriteName.PolyPointXAt(index), spriteName.PolyPointYAt(index) for this.

    Also there is spriteName.PolyPointCount to tell you how many collision polygon points there are :)

  • Hiya! Here's an excerpt from the manual:

    Stop loop

    Stop a Repeat, For or For each loop currently running. These loops are system conditions. The rest of the event's actions and subevents will still complete, but the loop will not run any further after that.

    This means that in your logic here, the loop is stopped but Construct still executes the remaining sub-event.

    You need to restructure your events :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hmmmm. I guess maybe you could do something manually, like... I dunno. An invisible sprite overlaying the whole slope, and when the player is overlapping it + is on the floor you move their X/Y coordinates at a 45 degree angle, perhaps? 🤔

  • Chrome on Mac is actually the Safari browser, so consider checking Sfari's settings.

    Uhhhh... what? Chrome isn't Safari. Chrome is Chrome, Safari is Safari.

    In any case, I have looked through every browser & OS menu I can find and haven't been able to disable this behaviour. It really seems like a C3 issue.

  • What the best resolution of the ViewPort Size for this kind of game ?

    Im using 16:9 / 854 by 480

    Can I use 16:9 / 426 by 240?

    You can use whatever you want! It's as much an artistic choice as anything else. Smaller resolutions will obviously perform better, but you may not like how things look at too low-res. It's a balancing act. Sometimes when I start a pixel art game project, I'll make a few test images at different resolutions to see what looks the best and what I'm the most happy with.

    if I increase to 1920 by 1080 , it will force me to have images larger than I should use in a small resolution correct ?

    Correct.

    I mean I want to have a game with a good performance , with nice resolution and that fit all devices .

    A noble goal, but you might find it's a good idea to get more specific about the devices you want to target. When you say "all devices", are you including mobile apps? You will likely have difficulty finding a resolution that performs well on mobile while also looking good on desktop PCs. And more to the point, few types of games are equally suited to PC, consoles, and mobile (most kinds of games work best on one platform or another). So rather than trying to please literally everybody, you may find it helps to pick one target platform and work towards that.

  • You can do System > Reset Persisted Objects so they get reset their initial state. https://www.construct.net/en/make-games/manuals/construct-3/system-reference/system-actions

  • After fiddling around with your c3p, I think you must be right about the angle being too steep. It seems that anything 45 degrees or steeper causes the player object to get stuck. Are you able to make shallower slopes?

  • You probably won't see much performance difference between those two options. Having 1000 objects in your layout when it loads, or loading in 1000 objects from arrays later, still ends up having 1000 objects in memory either way.

    To be honest, for something like Stardew Valley, you shouldn't need to worry too much about performance. Stardew has small pixel sprites and the world is split up into separate 'areas' for loading (it's not a seamless overworld map). It also contains a lot of asset reuse to keep the memory requirements down. I'd recommend studying how Stardew is put together and you'll be able to see some of the things the developer has done to keep things efficient.

    The most important things for performance IMO are keeping LARGE images to a minimum, not using loads of effects, and writing efficient event logic (as on a PC with a good GPU the main cause of slowdown will be dodgy code).

  • Thanks for the reply Kyatric, and very grateful for the reminder of the zoom reset key.

    I must say I'm not convinced about the browser/OS settings thing. I don't have this issue with any other program (eg. CMD+scroll gesture does nothing in Chrome, or even in the Construct start page - only in the editor tabs). It seems to be a 'Construct zoom', not a 'browser zoom' (I can trigger a browser zoom separately, anyway).

    I will look into this more however.

  • Yeah, I think it might have to be. As far as I can tell there's no way to do this. You'd think the ability to customise hotkeys to your own preferences would be an obvious feature to add :(

  • Hi folks. Upgraded to C3 from C2 a while ago (largely because I wanted to migrate to Mac from Windows).

    One issue I've been having that drives me insane is constantly "accidentally" changing the zoom level (eg. in the event view). CMD + mouse scroll gesture on Mac changes the zoom (which means every time I press CMD to copy and paste, undo, or any of a bunch of common actions) I am constantly accidentally changing the zoom level when I touch the mouse even a little tiny bit. It's WAY too sensitive too, so the tiniest touch causes me to zoom WAAAAAY out and then I waste loads of time trying to zoom it back to where it was. Quite distracting when you're trying to think about event logic :(

    I think there's a hotkey to change it back (not that I remember what it is), but honestly, I basically never want to change the zoom level anyway. Can I not just disable the CMD+mouse scroll zoom thing? I can't find the option anywhere.

    I hope I'm just being blind but any help would be appreciated :) Thanks.