Is it possible to return to a room in the state you left it, rather than being reset in GameMaker Studio 2? - game-maker

Currently I'm trying to implement a way that the user can quickly switch to a room that displays the instructions/controls. Once they're done reading them, they should be able to return to the room they were previously in in the state that they left it. What currently happens when I return to the room is that it has be reset to how it started.
I'm not calling anything like room_restart() or game_restart(), I'm just using room_goto(num) to navigate between the game room and the instructions room.

An easy way around would be to mark your room as persistent (room_persistent = true) before transitioning to instructions room and unmark it after transitioning back.
A more proper way would be to not transition the room at all, instead deactivating the game objects (instance_deactivate_all(true)) and then activating them again (instance_activate_all()) - just like you would for showing a pause menu.

I have done this a lot in my games. All you need to do is save the current game state, then switch to a room with the controls. Use - game_save("example.dat") then open it when you want to return. There are many tutorials on game saving and loading!
game_save("level.dat")
room_goto(rm_controls)
then
game_load("level.dat")
Hope that helps!

Related

Changing my website cursor into a coffee icon, pouring coffee whenever the user clicks on something

I have a personal website and I want to spice it up a bit while also learning some front-end.
An idea I had was that the cursor of my website would be a coffee instead of the default one, and anytime I click on any content, the coffee pours.
Any idea if this is possible and if so, what I need to do to implement it?
You can change the cursor using CSS - see https://www.w3schools.com/cssref/pr_class_cursor.asp and do something like
div {
cursor:url(myCoffeeJug.cur),auto;
}
You could then use Javascript to change the cursor shape (ie URL) when the user clicks in the div. You'd need to think how to change it back again after whatever operation the click triggers is complete.
Note that you can't do animations this way - but given that clicking on a div is likely to be quite a quick action, just switching to and back from a different icon might well be enough for what you want.
However this is perhaps not a great idea from the usability point of view. Web users are used to the basic types of cursor provided by browsers - overriding them may be cute, but it can also be confusing.
If your site is designed for 'ordinary' users looking for information or functionality (rather than for web designers, or as a showcase for your techniques), you're putting a small barrier in their way. Users who are not confident, or are new to all this, or non-neurotypical users may find it off-putting.

Using QT For Creating a Screen Dimmer

I'm trying to implement a screen dimmer using QT4 and I wanted some advice before I get cracking instead of going into this blindly.
I want to create a top-level window that has no frame. I was thinking of making the background black and messing with the opacity so that it will dim the screen out after the system is idle for a given period of time.
The problem with this is that if this window is always on top, how can I pass click events to the window underneath it? I'm not the least bit familiar with the windows API (the solution only has to work under windows), but I'm guessing that's a good place to start. Can anyone point me to some useful classes/functions or suggest another way of doing this via QT?
If anyone's interested in the solution I came up with and the windows API functions I used, you can check out my blog posting here: http://sarcastichacker.com/getnextwindowandgetforegroundwindow
I will be updating the source and making another related posting on the same blog within the next couple of days.

How to create an background activity in app inventor

I wanted to create an app in appinventor that would switch screen right/left depending on what side the phone is shaken while unlocked. But couldnt figure out:
a. how to make application run in background.
b. what property i am going for. Like what tells phone's screen to scroll left or right when finger slides across the screen. What method is called. I figured view class would have to do something with it. Having no java experience i couldn't make much sense out of sdk,refernce,resources etc.
Please help me out, i will give you credit for it.
Oh also i think i might have to include "activity starter" too.
It's an issue for app inventor
http://code.google.com/p/app-inventor-for-android/issues/detail?id=32
star it to show you are interested
The standard Application Inventor 2 website, as you surely know, is this one:
http://ai2.appinventor.mit.edu/
However, there is another one, which allows using background threads (services):
http://services.appinventor.mit.edu/
It has a feature not available on the standard (official) AI2 website, the Add Task functionality, which allows adding tasks that will keep running even after a screen have been closed.
However, since it is an unsupported version, whose last release is dated from almost 1 year ago, I did not spent time making experiments, but this migh meet what you need:
The website will turn down, but worked like a charm before.
The whole concept was based on a Master Thesis: https://dspace.mit.edu/bitstream/handle/1721.1/100626/932752939-MIT.pdf;sequence=1
The last message from the site was something like: Google change the concept of background service architecture which cause the 'taks' concept to obsolate and prevent to work in the future.

How accessible is Fullcalendar?

I'm having problems making FullCalendar fully accessible. I'm using the default month view and can't access the next, previous, and today buttons on the top right without using a mouse. If I run a screen reader, I can access those buttons but not without running the screen reader.
And on another note, I currently am using tool tips that pop up when you mouse over an event title to display more information. If anyone has any tips on how to make those accessible to a screen reader or accessible without a mouse, I'd greatly appreciate it!
Regarding the buttons, I would advice that you write new buttons if accessibility is important. These buttons you could then hook up to your own javascript functions that moves to previous and next.
Check out this documentation example
Regarding the second problem, I think that's the same problem not just for physically impaired but also for things like mobile browsers. My tip would be to avoid onmouseover if the information that appears is really important.

QtEmbedded (for Kindle!): How are the device plugins supposed to get feedback from the app?

I'm not having an easy time making a workable mouse pointer interface on the Kindle with Qt (unofficial, of course). The fiveway joystick can't track more than one direction at a time (no diagonal moves), and the screen is too slow to update for good feedback.
I've got limited acceleration, but with the screen delay it's very frustrating to use. When you release the fiveway, the mouse will keep moving for 1-2 seconds... and it's not always a constant delay.
Given these limitations, I really need help from the application side. I need a method the mouse driver plugin could use to identify what the acceleration profile should be... so it can say slow down as it crosses a button. The app could help define regions where different acceleration made sense (start with single pixel shifts in a drawing area, but start at 10 or so for dialog dead space). More simply, the application should be able to tell the mouse pointer to transition from cursor to keypad mode, etc.
However, I can enumerate the mouse drivers, but I don't seem to get driver names. They're not QObjects, so there's no qobject_cast. How can I identify them as mine, and safe to cast to? I can force a cast, but that seems pretty lame.
Do I just assume the plugins are mine and cast them?
I'd like some simple signal/slot way to wire this up.
UPDATE
Maybe the plugins can notify the app somehow. Maybe using QApplication::topLevelWidgets(), trying qobject_cast looking for the QMainWindow... then sending it a custom signal with the plugin's internal QObject-based signal handler class? Then the app could turn around and set up the connections it actually wanted to deal with. I'll try it tonight or tomorrow.
Why don't you implement right as "tab" and left as "shift+tab". That way, you can move the focus around. Now, just center the pointer over the active area of the widget with focus (think checkboxes, they need the pointer over the box, not the center). I expect the user to be more interested in this and actually having a pointer to mover around in an environment where it is down right impossbile to use.

Resources