Labels

Sunday, April 14, 2013

MDDN 352, Click and Drag

The Click and drag aspect of my app is something which is going to happen a lot. I mainly want it for the scene in which Mr Whistler is getting changed. I want it that you have to click on the object of clothing and and drag it onto the character so that he can get changed.

So what is happening in the code about is that at the beginning the image for pants and Mr Whistler in his boxers are visible but the image of Mr Whistler in this pants isnt. There is a start and stop drag function added only to the pants so that it is the only thing which can move. The pants also have a boundries so that they cant leave the screen. What happens if they are dropped outside of the screen is that they just bounce back onto the screen.

In the stop drag function there is an if function which says that if the pants are dropped in a specific area which is over Mr Whistler that the pants and Mr Whistler in boxes visibility is turned to false and Mr Whistler Pants is set to true.

Here is a quick video showing what I just said


No comments:

Post a Comment