"Background" actions. - Newbie question

View previous topic View next topic Go down

"Background" actions. - Newbie question

Post  MukiEX on Fri May 15, 2009 7:19 am

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.

MukiEX

Posts : 6
Join date : 2009-02-28

View user profile

Back to top Go down

Re: "Background" actions. - Newbie question

Post  Don Jaffa on Fri May 15, 2009 7:27 am

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 Razz).

Don Jaffa

Posts : 49
Join date : 2009-02-19

View user profile

Back to top Go down

Re: "Background" actions. - Newbie question

Post  MukiEX on Fri May 15, 2009 10:30 am

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.

MukiEX

Posts : 6
Join date : 2009-02-28

View user profile

Back to top Go down

Re: "Background" actions. - Newbie question

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum