Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: Mmo

  1. #11
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    So.. you don't know how to control an MC? Do you want to use the arrow keys?

    Code:
    onClipEvent (load) {
    
    moveSpeed = 3;
    
    }
    
    onClipEvent (enterFrame) {
    
    if (Key.isDown(Key.RIGHT)) {
    
    this._x += moveSpeed;
    
    }  if (Key.isDown(Key.UP)) {
    
     this._y -= moveSpeed;
    
    }  if (Key.isDown(Key.DOWN)) {
    
    this._y += moveSpeed;
    
    }  if (Key.isDown(Key.LEFT)) {
    
    this._x -= moveSpeed;
    
    }
    
    }
    Mouse?

    Code:
    package com.asgamer.mousecontrolled
    {
     
    	import flash.display.MovieClip;
    	import flash.events.*;
    	import flash.display.Stage;
     
    	public class Hero extends MovieClip
    	{
     
    		var stageRef:Stage;
    		var speed:Number = 7;
     
    		public function Hero(stageRef:Stage) : void
    		{
    			x = stageRef.stageWidth/2;
    			y = stageRef.stageHeight/2;
     
    			this.stageRef = stageRef;
     
    			addEventListener(Event.ENTER_FRAME, loop, false, 0, true);
     
    		}
     
    		private function loop(e:Event) : void
    		{
     
    			var yDistance:Number = stageRef.mouseY - y;
    			var xDistance:Number = stageRef.mouseX - x;
    			var radian:Number = Math.atan2(yDistance, xDistance);
    			rotation = radian * 180 / Math.PI;
     
    			x -= (x - stageRef.mouseX) / speed;	//easing
    			y -= (y - stageRef.mouseY) / speed; 	//easing
     
    		}
     
    	}
     
    }
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  2. #12
    Join Date
    Apr 2010
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I am pretty much aiming to turn http://www.calumscott.com/castiel/engine/ multiplayer.

  3. #13
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Okay, I get that. And you use a socket server, and you can log-in, and chat and all of that, you just can't make the characters walk? This is where I lose you. Having a character walk is very simple, as stated before. What exactly are you having problems with?

    Perhaps re-word it, because I am probably just not understanding you.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  4. #14
    Join Date
    Apr 2010
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I'm not sure when to send the target x and y back to the client. For example, if the character is not moving, and you select a tile, the server calculates the path and sends the tiles in the path 1 at a time after a set amount of time. I'm just not sure how to handle it :P

  5. #15
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    If, I get you right you need to use Flash Objects. ElectroSever uses EsObjects. Objects are Objects though, you will just need to check your socket server readme's for the correct terms.

    Now, in simplistic terms you already have cell numbers, used in your path finding. The cells that the character moves over need to be stored in an Object array. This array is then sent to the server, and then on to the other modules and connections so the character appears to move on the other peoples monitors.


    Just put it in an if statement, For IF xor y changes then.. store array and send to server.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  6. #16
    Join Date
    Apr 2010
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I understand how to send data. It was the theory I was stuck on. However, last night I managed to get serverside pathfinding working perfectly with no bugs.

    However, I'd still like to meet anyone with a passion for multiplayer game development. I love learning new techniques and approaches to different problems

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •