"Background" actions. - Newbie question
2 posters
"Background" actions. - Newbie question
A newbie section would work best, but this is my best guess as to where to ask this question.
I'm beginning to get the hang of using SIO2, so I need to know, is there a simple way to set up an action to occur that isn't dependent on user input? I can see how to react to touching the screen, but how would I go about making things happen that aren't dependent on that? For instance, if I was making a shooter, and enemies were moving about, where would I put the "update" code for their movements? There doesn't seem to be anything in template.mm for that.
Yes, I'm aware of how silly this question sounds, like I mentioned, ultra-beginner talking here.
I'm beginning to get the hang of using SIO2, so I need to know, is there a simple way to set up an action to occur that isn't dependent on user input? I can see how to react to touching the screen, but how would I go about making things happen that aren't dependent on that? For instance, if I was making a shooter, and enemies were moving about, where would I put the "update" code for their movements? There doesn't seem to be anything in template.mm for that.
Yes, I'm aware of how silly this question sounds, like I mentioned, ultra-beginner talking here.
MukiEX- Posts : 6
Join date : 2009-02-28
Re: "Background" actions. - Newbie question
In the main render loop (TemplateRender or whatever you are using) just add an action without any stimulus. The render loop runs until the end then loops until it is told to stop, so if you add an action without any preconditions it will run without any input from the player (I'm still a bit of a noob to programming / SIO2 but unless I've fundamentally misunderstood the engine this is how it works ).
Don Jaffa- Posts : 49
Join date : 2009-02-19
Re: "Background" actions. - Newbie question
Any idea how to keep it from tilting sideways? I already disabled Landscape mode, but the "Loading" screen is still landscape, and it still auto-tilts the iPhone simulator to the right 90 degrees.
Edit: Nevermind, figured it out. For those tuning in:
Go to the "Classes" folder.
Edit templateAppDelegate.m
Find the line:
[[UIApplication sharedApplication] setStatusBarOrientation: UIInterfaceOrientationLandscapeRight animated: NO];
Comment it out (place two forward slashes // in front of it).
So with that out of the way, anyone know of any tutorials on coding "gestures"? e.g. a finger swipe or some such.
Edit: Nevermind, figured it out. For those tuning in:
Go to the "Classes" folder.
Edit templateAppDelegate.m
Find the line:
[[UIApplication sharedApplication] setStatusBarOrientation: UIInterfaceOrientationLandscapeRight animated: NO];
Comment it out (place two forward slashes // in front of it).
So with that out of the way, anyone know of any tutorials on coding "gestures"? e.g. a finger swipe or some such.
MukiEX- Posts : 6
Join date : 2009-02-28
Similar topics
» Newbie question about decompression
» Newbie question, code signing error when trying to run tutorial1
» Getting objects to "stick" to a surface with friction
» 2d background image to tutorial15
» Newbie: Multitouch
» Newbie question, code signing error when trying to run tutorial1
» Getting objects to "stick" to a surface with friction
» 2d background image to tutorial15
» Newbie: Multitouch
Permissions in this forum:
You cannot reply to topics in this forum