Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to create a 2d shooter for Android. How do I spawn enemies "above" the screen, so that they "enter" the game screen instead of spawning at the top of it?

I think I need to make a game screen that is bigger than the actual view. How would I do this? I know that negative y-values would work, however that's not really the same.

EDIT: I'm using canvas and bitmaps.

share|improve this question

closed as not a real question by Byte56, msell, Nate, Josh Petrie, aaaaaaaaaaaa May 6 '13 at 20:45

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

I edited the question for clarity and removed the other questions in the process. You can still ask them as separate questions - it's just easier for people to find information if each question is really one question. – Anko Apr 23 '13 at 11:10
Why aren't you using negative y values if they would work? – Byte56 Apr 23 '13 at 14:06
Don't overanalyze it! It's perfectly fine to use negative x y values. – bryan226 Apr 24 '13 at 5:03
What they said, in addition, your enemies won't need background and stuff while off screen, if that is what you worry about, they just don't care. – petervaz Apr 25 '13 at 13:31
up vote 3 down vote accepted

As mentioned in the comments, you could spawn the enemies with negative y-coordinates. However, if for some reason you can't do that, you can instead have a "game screen" that is bigger than the size of the view screen. Just render the center part of this game screen, and spawn enemies on the non-rendered outer edges of the game screen.

share|improve this answer
I'd be curious to know why the OP can't use negative x and y values - they've always worked fine for me! – BungleBonce May 3 '13 at 9:46

Not the answer you're looking for? Browse other questions tagged or ask your own question.