Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

Advanced search

1211910 Posts in 52586 Topics- by 43386 Members - Latest Member: cyborg_ean

May 03, 2016, 02:08:43 pm

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderators: Glaiel-Gamer, ThemsAllTook)Multi-Player Flashpunk/AS3 Entity System
Pages: [1]
Author Topic: Multi-Player Flashpunk/AS3 Entity System  (Read 717 times)
Level 0

View Profile Email
« on: April 06, 2013, 04:48:52 am »

My goal in mind is to create a game, using FlashPunk and AS3 (my preferred library + language), which is multiplayer/local computer type thing. My current design is using one PlayerEntity class which all characters for the game extend. PlayerEntity controls all movement of the characters and things, while each player class that extends it sets it's controls and speed variables.
Just to show my code, here is a link to the two files of PlayerEntity, and one of the characters:
Currently, I have two different Player extension classes with different Key Press combinations and variables. I spawn both in my GameWorld class, both classes spawn but only the second one I spawn out of both actually controls movement... AND the movement of the both entities.
Any help trying to fix this poblem will be appreciated Smiley
Level 4

View Profile WWW Email
« Reply #1 on: April 06, 2013, 05:03:28 am »

I'm kinda guessing here as I've not spent too long with AS3/Flashpunk yet, but I think Input is a global static thing, so by mapping "left" "right" etc twice, the second time is just overwriting the first.

So declare player 1, map keys to arrows, then declare player 2, overwrites previous mapping to WASD or whatever.

Pages: [1]
Jump to:  

Theme orange-lt created by panic