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

Login with username, password and session length

 
Advanced search

1057141 Posts in 42938 Topics- by 34885 Members - Latest Member: nmonte

October 25, 2014, 02:09:14 AM
TIGSource ForumsDeveloperTechnical (Moderators: Glaiel-Gamer, ThemsAllTook)Multi-Player Flashpunk/AS3 Entity System
Pages: [1]
Print
Author Topic: Multi-Player Flashpunk/AS3 Entity System  (Read 595 times)
JaydenB
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:
http://pastebin.com/kT9jFkKr
http://pastebin.com/ibDfgBpc
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
Logged
Claw
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.
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic