How to create custom Action in cocos2d-x - c++

I am new to cocos2dx and I want to make my own custom action like MoveTo or MoveBy.
Please help me
Thanks in advance

Cocos2d-x having number of Actions like MoveTo/By, RotateTo/By, ScaleTo/By, FadeIn/Out, TintTo/TintBy....
Furthermore you can create complex Actions by sequencing two or more actions by Sequnce Action.
If you need own implementation create child of ActionInterval and implement your own requirement.
An interval action is an action that takes place within a certain period of time. It has an start time, and a finish time. The finish time is the parameter duration plus the start time.

Related

How do I conditionally elicit an Alexa multi-turn dialog

I have a customer requirement that necessitates a conditionally prompt from Alexa. Basically, the user will ask {intent} {utterance}, the back-end will check their account to see if they have more than one item in a list; if so, it will ask "which one item 1 or item 2". They will need to respond with 1 or 2.
If there is only one item in their list, it will default to that item and not require input from the user.
My understanding of how multi-turn dialogs works is that I must create a dialog model with at least one required slot. As you can see in my example, there isn't always a required slot.
Is this possible? If so, can you outline (at a high-level of course) what steps I should take?
Note: Unfortunately, one of the requirements is that the endpoints be handled in Azure; therefore, I must utilize Alexa.NET instead of the typical SDKs. Not sure if that changes anything.
Dialog handling
Yes it's possible.
After your:
ask {intent} {utterance}
it will hit your backend with dialogState STARTED
now you can check if you have multiple items
yes(multiple items): delegate dialoge handling back to alexa and alexa will ask for the slot number. You now check if dialogState = COMPLETED and so on
no (only one item): just respond back to the user without dialog delegation
SDK
It does not make a difference with Alexa.NET if dialog handling is implemented there. I also struggle sometimes to find examples for the Java SDK ;-).
Here is a video which helped me.

How to detect a period of inactivity in EmberJS?

I am trying to detect a period of user inactivity in my EmberJS application so that, after a certain duration I can call a session.inValidate method and revoke their authentication.
The only resource I have been able to find is an article here which I was advised in an original question is out of date and doesn't use current Ember concepts.
The out-of-date article suggested adding a property to the App object and updating the property on certain events like mousemove but I was unable to find a location to set this property correctly in either app.js or the config environment.
ember-concurrency was recommended but after looking at some of the documentation I still don't understand where such code fits in an EmberJS application structure.
Unfortunately I'm stuck at a point before I can give a code sample. Any advice is appreciated.
Edit: As per #hernanvicente excellent question, I am defining inactivity as 'no user input'. So no mousemove or key press events within X period
The hard question here is what activity actually means. Generally I would advise against your idea. There is no way to know if the user is actually still looking on your page.
However if you really want to do something after the user hasn't done something for some amount of time the interesting question is where to place your code.
You have multiple options here, but probably not the worst option would be to use the application controller. You could also use a service, but then you need to use that service somewhere to initialize it. You could also just use a component.
If you want to couple this to authentication you could consider to use the existing session service.
However everything else is not really ember specific. You can just place some code in the application controllers init hook and access document.addEventListener(). Then you could just save a timestamp away and act accordingly.
To have a bit a nicer API for waiting you can utilize ember-concurrency with a restartable task:
didSomething: task(function * () {
yield timeout(1000); // number of miliseconds to wait
logout();
}).restartable(),
here logout() will be called, after the task hasn't been called for 1 second. A nice visual demonstration about task concurrency and restarable can be found here.
Here is an ember-twiddle showing a complete example.

TFS Allow all states for a work item

Is it possible to open up all possible states for a work item - essentially removing the state transitions?
I am hoping to use a tool outside of TFS for managing work items and would like to know if it's possible to simply allow all states at any time?
If you want to remove the transitions between work item, you need to customize the work flow.
You change the workflow to accomplish the following objectives:
Add or remove a state, reason, or transition.
Specify a value for field to be applied during a change in state,
reason, or transition..
Specify a custom ACTION to automate field assignments based on a
change in state, reason, or transition.
Detail steps to customize the workflow and more info about it, please refer this Modify or add a custom work item type (WIT) from MSDN.
Moreover, here is a 3rd party extension called TFS Work Item Manager which is an innovative team workload coordination platform that helps you manage your TFS work items in a much more efficient and intuitive way. You can also take a look at it.

How to run two actions at the same time cocos2d

So I know CCSpawn and I have been using it to run multiple actions at the same time, but now I am encounter a problem. I made a game character that's only last for a short period of time and then disappears, and I want to use CCBlinks to notify user about it. So I want to know how I can combine CCBlinks with whatever action the character is doing? For example, character's current action state is attacking, how can I combine attacking action with CCBlinks action?

Cancel service call in Dojo

I want to know if it is possible to cancel a call to a webservice using Dojo. My problem is, e.g., that the user has many elementes to select in a map, and every time he clicks on one of them a call to a webservice is excuted to bring an important volume of data. This operation takes a few seconds of latency. Imagine that user clicks on five elements almost simultaneously: there will be a selected element (the last clicked), but the info panel will be refreshing periodically with the info of the previous elements clicked until the last element info is loaded.
What I want is to cancel all the previous calls (if it possible) and only allow to complete to the last one. I'm working with Dojo. I've seen the documentation but I haven't seen anything useful. Something like the "ajax.abort()" method is what I would expect to find.
I have also thought to create a class to manage the calls and add to a queue every call to a same url in order to only let the last call to render the data, but by this way I still would to wait to complete every service call and then discard the results. I think that the proper way to proceed is to cancel the old calls.
Any suggestion? Thanks.
After search in some forums and pages, I've found this one: www.mike-griffith.com - Cancel dojo XHR in progress. This is exactly what I was looking for (although in the web example is used to "GET" services, the "cancel()" method also works for "POST" calls).
So I will combine the service calls manager with this code to cancel calls with the same url. I also have to manage how to avoid (if I am able to) the raised error when a call is canceled, but this is other task and much less priority.