Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7962687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:24:27+00:00 2026-06-04T05:24:27+00:00

I am making a game in android in which enemies are randomly spawned at

  • 0

I am making a game in android in which enemies are randomly spawned at the top of the screen and move down. I am able to create 1 enemy that does this, but I can’t think of a good way to create many enemies that are all drawn on the same canvas. I have tried many things, and I could really use some help.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T05:24:28+00:00Added an answer on June 4, 2026 at 5:24 am

    The easiest way to do this is to create a class Enemy (name it whatever you like) and instantiate as many as you need using a for loop. You could use an array to store each instance.

    An example could be the following:

    Enemy[] arrayOfEnemies = new Enemy[sizeOfArray];
    for(int i = 0; i < arrayOfEnemies.length; i++) {
        arrayOfEnemies[i] = new Enemy();    
    
    }
    

    Then you can use an enhanced for (or for each) loop to display them wherever you’d like on your canvas.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am making an android game that spawns enemy sprites at a certain interval
I am making an android game that should delete some falling images from the
I am making an android game that should display a message that you have
I'm making a simple 2d game for the android platform, which works perfectly from
I am making a game for android which needs to play a small beep
I am making a game on android which will have three threads. These will
I'm making my first Android game which is going to be a 3D arcade-ish
I'm making an android maths game which gives users the some questions to answer
We are in the making of an Android app, a quiz game, which we
I am making game for android using libgdx my requirement is that when character

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.