combine events for local Multiplayer

0 favourites
  • 1 posts
From the Asset Store
"Easy Local Notifications" enhances games with customizable local notifications.
  • Hi guys,

    in the near future i want to work on a multiplayer game for iPads.

    Since the information on mobile platform development is scattered over the whole board, i was thinking of creating a game step by step and discuss every problem i will face during this process.

    I decided to go for a four player local multiplayer battle where each player has it's own joystick in the appropriate corner.

    it should more or less look like this.

    [2][https://googledrive.com/host/0B9IR6fhnjEUvMlhZaU1uR3NCUWc/index.html]

    The first decision i had to make was for the screen size and resolution.

    Since the iPhone screen is to small to play with 4 players, my target platform is only iPad gen 1-3.

    I read that it would be best to pick the best possible resolution with the same aspect ratio for all devices, which is 2048, 1536 (iPad 3Gen)

    For the "Fullscreen in Browser" i chose "Letterbox Scale" because it's said to be the best for mobile devices.

    For more information have a look at

    [3][https://www.scirra.com/tutorials/73/supporting-multiple-screen-sizes/page-1]

    as said in this topic, the performance won't be a problem if scaling the screen down in a lower resolution. for example ipad 1

    [4][http://www.scirra.com/forum/a-thought-on-mobile-image-resolutions_topic51062.html]

    the second problem i had to face, were the 4 different fingers touching the iPad at the same time.

    i played around with touchID's and invisible sprites and came up with this:

    here's a live Demo

    [5][https://googledrive.com/host/0B7m-eoWIKsSMeVNlVzBzMTdFanM/index.html]

    test it on an iPad to move both at once

    and this is the capx file.

    [6][https://www.dropbox.com/s/j5v8oi5ruuyyp4y/multiple_touching.capx]

    I am right now facing something, which is not really a problem but it would be great to know a solution.

    Because i have four players, i have 4 different controls, player characters and bullets.

    right now i repeated exactly the same events for every player.

    can i create something like:

    "on touch of Control_Left.ID(2), move Player.ID(2) to the left"

    like 3 events for left, right and to define somehow to pick the player with the same ID as the controls have.?

    is there another way to achieve this?

    I've been discussing this topic in this thread:

    [7][http://www.scirra.com/forum/topic72500.html]

    Here's a quick view on my events:

    <img src="https://www.scirra.com/images/articles/players.png" border="0" />

    and here's the latest version of the capx

    [8][https://docs.google.com/file/d/0B9IR6fhnjEUvWWlxNGdxU1IyV1k/edit]

    the second problem which i'm facing is the combat. it's a bit similar. I have 4 different player characters and four appropriate bullets. now i want the bullet 1 to destroy p2,3 and 4 on collision but not p1. And bullet 2 i want to destroy p1,3 and 4 ... and so on.

    i tried a lot of things with families and instance variables but i was not comfortable with it.

    Of course as soon as i know how to do these things i will write it down here because i want it to be like a full report on what problems i faced for you as a tutorial. I will constantly continue to develop my game.

    as you might have noticed, there aren't any nice sprites in it and so on. My graphic support is working on it and i will let you guys have a preview as soon as possible.

    For next steps are planned:

    • Power UP's
    • Combat Engine (Bounce of Walls, Teleports, Time, Respawn ... and so on)
    • Achievements

    I haven't got the time right now to commentevery step but i will post problems and solutions here and maybie comment everything like a tutorial when the game is finished.

    cheers!

    phil

    26.08.13

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)