Unity3d how can i program my game? - game-engine

I am creating an Android 2d game in unity3d game engine. I've created an endless map and a continuously moving ball is my character. I've got some pits digged on my platform. If the user clicks anywhere on the screen, the ball will bounce. Now, if the ball accidently fell into the pits, I want the game to stop(meaning the game has failed) and restart from the beginning.
Can anyone pls tell me the script or code I've to use for the game to restart ????
Any help would be great!!!!

You could fill the Pits with Box Collidiers wich are marked as Triggers.
Then you write a Script with
void OnTriggerEnter(Collider other){
if(other.gameobject.tag == "Player")
//do something
}
Doku OnTrigger Enter
That should do the Job

Related

Take pictures using camera shutter when receiving live view data

I am developing using EDSDK.
However, if I press the shutter of the camera (physical button) while receiving live view data(EVF Mode), the picture won't be taken. Is this normal?
My camera model is 200D II.
What I'm trying to do is as follows, and it's very simple.
My software activates the camera through EDSDK and receives live view data.
The person behind the camera takes a picture by pressing the camera shutter, and my software shows the picture on the screen.
The questions are as follows.
How to take pictures using physical camera shutter buttons when receiving live view data(EVF).
HDMI connections are not considered because there are features that need to be controlled directly through EDSDK.
Thank you.
Below is what I added after Johannes Bildstein's answer.
As Johannes Bildstein answered, the following code was inserted to unlock the UI.
But it still hasn't been solved.
if (!MainCamera.IsLiveViewOn) {
MainCamera.StartLiveView();
MainCamera.UILock(false);
}
Error message occurs when I try to unlock UI and get EVF data. (Shutter still doesn't work)
If I unlock UI after receiving EVF data,
When dial is in photo mode: EVF data is coming in, but the shutter still does not work.
When dial is in video mode: EVF data does not come in due to BUSY error. Is it a conflict due to UI unlocking? We check your answers and SDK documents and try in many ways, but they are still unresolved. We are currently testing the more recent model, 200D II.
"| EvfOutputDevice.Camera " should be added like below!
public void StartLiveView()
{
CheckState();
if (!IsLiveViewOn) SetSetting(PropertyID.Evf_OutputDevice, (int)(EvfOutputDevice.PC | EvfOutputDevice.Camera ));
}
The camera "UI" is probably locked. The EDSDK does that automatically when connecting and before doing certain commands. You can unlock it with EdsSendStatusCommand using kEdsCameraStatusCommand_UIUnLock.

Add an application title, and an image, to Win8's startup splash screen

I work at one of those benighted companies that don't realize the benefits of living entirely within the MS world. (My bosses are so deluded by social media group-think they actual make us use PyQt4, but that's neither here nor there...;)
So, in terms of saving me a lot of bookyuck, how does an app that is NOT generated by Visual Studio put all of ...
a rotating picture
a string of text
... into MS's vaunted Win8 start splash screen?
I think it has something to do with writing a package.appxmanifest, and putting some splashscreen.jpg goodness inside that. Then I send the manifest to the splash screen by ... what? Registering it? Installing it with the right-click context menu?
What's the shortest path to this simple task?
See Desktop App tiles on the Start Screen, but it's not what you were hoping for.
Obly Tile looks interesting, but I suspect that's something they do ex post facto to put a shell around a desktop app that's already installed, but perhaps that's sufficient for your needs?

Star a song in spotify from an external source?

I'm looking for a way to star a song in Spotify without having to go to the app itself.
For instance:
I'm playing a game on fullscreen, or I'm working on something and Spotify is on for music. I hear a great song and I want to star it.
Now instead of going to the app, I want to star the song using a shortcut or a dedicated external button.
Whether it is a shortcut, a USB button, or a button on a remote, I believe this function would be really helpful. I've searched through the Spotify core API, but I couldn't find anything that enables me to "star" a song.
Any ideas?
Since you tagged CocoaLibSpotify in this question, well, CocoaLibSpotify has this functionality built right in - the SPTrack object has the starred property. It'd be fairly simple to write a little app that, when triggered, fetches the currently playing track using the Spotify client's AppleScript bridge and use CocoaLibSpotify to star it.
Alternatively, the Apps API can star a track as well (the Track object has the starred property). You could use the player object to get the current track and star it. However, linking that to an external button will be tricky. One (hacky) way would be to have the button trigger a system URL launch of spotify:app:star-this-track:invocation:1 where the number at the end increments each time you push the button. Then, the application's ARGUMENTSCHANGED event will fire, at which point you can star the track.

Game Center for my iPhone Game

I am developing an iPhone game, and I will implement Game Center in it.
Apparently, I need to do some configuration with my application in iTunes Connect first. Therefore I have to "create" my application in the iTunes Connect page, right? But, how do I do that without getting Apple's staff review my app since I am still working on it?
I tried making a new app like normal, but it asks me for a bunch of stuff like screenshots etc, but I have none to offer in the first place...
Fixed. It seems they won't even review it if there is no binary uploaded yet.

Disable iphone home button in app, is it possible?

I want to develop a screensaver-like app where the only way of getting back to the springboard is entering a code. Therefore I would need the Home Button action to be ignored, that is that when the user presses the button nothing happens..or something custom...instead of going back to the springboard and terminating the app.
Is this possible? does anybody know if apple will approve/reject this kind of app?
The answer to your question is, yes.
The answer to the question you meant to ask--can I ship an app through the iPhone store that has the home button disabled--is no.
If you are only publishing your app to jailbroken phones you can do it, but it will piss everyone off.
Edit 7 years later:
This is actually extremely possible now--there is a standard feature in the iPhone called "Guided Access". It's hidden under that "Accessibility" Link (With some other fairly cool stuff like flashing the LED whenever you get a call and allowing a Bluetooth keyboard to tab between controls)
It's called "Guided Access". You set a passcode, launch the app then triple-click the home button to start guided access.
It disables exit and allows you to designate regions of the screen you can't touch. You can also set a time limit (For kids playing which seems to be the reason a lot of people look up this question).
Tempted to edit the "Accepted answer" and throw this info in there, but that seems rude so I'll just hope people find this answer.
Annoyingly you also seem to be unable to shut off the phone--I suppose this is perfect for people who want their kids to play a game, but might not hit the original asker's problem of restricting access to a single app (I mean it WILL do that but it'll also prevent it from doing ANYTHING else).
Not with public APIS (and hopefully, not with private ones). Even if you manage it somehow, Apple will reject it for breaking UI guidelines. Moreover, even if they didn't, people could always use the iPhone's "Force Quit" equivalent to hard terminate your app.
Apple is not going to approve this type of app, they state pretty explicitly that you're app needs to respond appropriately to springboard telling the app to terminate both when things like phone calls come in and when memory warnings come in.
This is not possible with the current SDK, nor do I suspect it will ever be.
You might be able to get this behaviour via jailbreaking, but you won't be able to sell your app through iTunes, nor will Apple ever approve such an application.
You can do it like this
Install the following mobileconfig file
This will disable the home button once you launch the app
Download
Found the link Here
Apple won't allow it.
What if something emergency happens and you wan to dial an emergency phone number. You are putting the user at risk. The trade-off isn't worth it.