Discord
Login
Community
DARK THEME

pressing CMD + S / CMD + W or CTRL + S / CTRL + W (for Windows)

Pressing CMD + S while playing the character makes the player move down infinitely (if you're making a top down that is), i've also tried it with CMD + A and CMD + D and those both make the player move infinitely in the respective directions CMD + W however, Crashes the entire engine(i'm using the offline version if that helps)

Put sample code or link to the program.

I know at least in most browsers that CTRL+W closes the current tab, not sure about microstudio though. As for the others, is it possible that CTRL+S/A/D are opening popups or something with windows? Anything that might redirect the computer's focus?

https://microstudio.dev/community/bugs/pressing-cmd--s--cmd--w-or-ctrl--s--ctrl--w-for-windows/489/1/

yeah i don't know, but i'm a Mac user. Also that is true, it might be redirecting the computers focus

and here's the script:

init = function() status = "Average kid" level = 1 position_x = 0 position_y = 0 end

update = function() if keyboard.LEFT then x = x-1 end if keyboard.RIGHT then x = x+1 end if keyboard.UP then y = y+1 end if keyboard.DOWN then y = y-1 end end

draw = function() screen.fillRect(0,0,400,400,"rgb(28,85,85)") screen.drawSprite("player_regular",x,y,75) end

that's about as simple as it gets.

thank you both for your time! :)

also yeah sorry XD. It looks like CMD/CTRL + W is the is the shortcut for closing the engine

also that's not what the spacing and syntax looks like in the engine. The text box just messed things up when i posted it

Suround source code with ``` at first and last line to format it :)

Here's the formatted version of the script:

init = function() status = "Average kid" level = 1 position_x = 0 position_y = 0 end

update = function() if keyboard.LEFT then x = x-1 end if keyboard.RIGHT then x = x+1 end if keyboard.UP then y = y+1 end if keyboard.DOWN then y = y-1 end end

draw = function() screen.fillRect(0,0,400,400,"rgb(28,85,85)") screen.drawSprite("player_regular",x,y,75) end

anyone got any ideas on how to fix the CMD/CTRL thing?

I thought a way to fix it might be to just make it so when you press that key it has a null output.

it's kind of a small thing, but it has the potential to either mess someone up while they're enjoying the game, or possibly even cheese the game in some way. I just think it would be good to fix it. Because it shouldn't be happening

I know that in browser games at least, people learn to be careful around ctrl because of ctrl w, so I don't think it will be too much of a problem. Just don't bind control to something that you might do while moving (i.e. running, jumping, etc.) and you should be fine :)

The controls art the arrow keys, z, x, and c. You think it'll be fine? It's kind of in the danger zone, but your Pinky will naturally rest on CTRL.

It should be :) Plus, those issues (probably) won't happen on the exported versions, if you decide to do that :D For browser exports, I think you can manually edit the html file with some code to stop that from happening, but you'd have to ask someone else about that xD

i tested it on a standalone executable on mac, it still happens. but yeah, it's probably fine and i can edit the HTML file before building. I didn't even think about that! Thank you!

You're welcome :D I actually only thought of that because once I had a problem with the scroll wheel in browsers, in another engine XD

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community