Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Clone #2 (space local multiplayer game)

em2em2
edited October 2017 in Code Sharing Posts: 194

As a learning exercise, I like to clone interesting games I find, and ask for comments to improve my games and future ones. This game is a clone of this app.

Problems:

  • I have failed implementing levels and menus because currently I know no way to clear all physics bodies off the screen.
  • I also do not know if my class linking follows best code practices.

To run it, copy and paste the gist, save the assets, and change all the assetpack names in the code. (Search for "Project", replace it with "Documents" or whatever location you have saved them to)

Gist link
Asset link

Game controls: four players, each with one controller at the corner of the screen, turn ships with the right side of the triangular button, and shoot with the left side.

Tagged:

Comments

  • dave1707dave1707 Mod
    edited October 2017 Posts: 7,657

    @em2 See the built in reference for body.destroy() to remove physics objects.

  • em2em2
    Posts: 194

    @dave1707 I know that, but is there a built in destroy all function?

  • dave1707dave1707 Mod
    Posts: 7,657

    @em2 I don’t think so, but you can create your own function with a destroy for each object you create. That way one call will destroy them all.

  • em2em2
    edited October 2017 Posts: 194

    Good idea. physics.destroyAll would still probably be a useful addition to the physics library, or at least a simple way to access all physics bodies created.

  • Posts: 121

    That was the most painful copying of an asset list ever. Took me ten minutes. -.-
    1. Download zip into Documents
    2. Open Codea
    3. Find sprite name
    4. Go to Documents, save image to Camera Roll
    5. In Codea, find the image and name it
    6. Repeat step 1 until all assets are included

    Overall, silly but maybe fun game, needs sounds. Also, a spritesheet

  • em2em2
    edited October 2017 Posts: 194

    The assets.zip file can be opened in Codea directly. Did you try that?

  • Posts: 121

    @em2 Codea opens for a second then crashes. I'm still on iOS 10, so not sure if that's the reason, or something else

  • em2em2
    Posts: 194

    Forgive me for wasting your time.

  • @xThomas I'm on an iPad 3 which can't update past iOS 9, and it did work for me, I'll tell you how.

    It's roundabout but overall I'm really impressed with how careful TwoLivesLeft is to ensure backwards compatibility.

    So first you've got to get the file into your own Dropbox app on your device, which you can do from Safari. If you don't have a Dropbox account, that may be a rigmarole, but it's doable. From that app find the .zip file and tap export. Look for a button that's like "open in..." or "open in app...", tap that, an lo and behold there's an "open in Codea" icon.

    After you tap that, Codea will open, and it may take a second or two, but an import window will pop up asking you which files from the zip you want to import. Tap "select all" and it will import all the art, though unfortunately it won't tell you where it put it, which may be confusing.

    It put it in the root Documents folder, and let me know if you don't know how to get it from there into the a project folder for this project. Once the art is in this project's Project folder, you're good to go!

    Hope that helped!

  • @em2 did you see the reviews for the original app? The one Apple featured is hilarious. It said "everyone makes fun of me when I tell them to play this but it's really awesome!" Lol

  • Could you maybe add a simple instructions screen to the game? I figured out how to move and shoot but not how to lay bombs...

Sign In or Register to comment.