fdn2012

Member
  • Content count

    6
  • Joined

  • Last visited

Community Reputation

126 Neutral

About fdn2012

  • Rank
    Newbie
  1. Rectangle

    Hello. ballrec = new Rectangle((int)ballvec.X, (int)ballvec.Y, ball.Width, ball.Height); ballrec mean you want draw part of ball, In ball's coordinate system. Hehe. You try this: [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] 1.ballrec = new Rectangle(0, 0, ball.Width, ball.Height); 2.ballrec = new Rectangle(10,10, ball.Width, ball.Height); 3.ballrec = new Rectangle(20,20, ball.Width, ball.Height);
  2. Tile map structure

    Hello, It's very interesting. I think it's a triangle. [url="http://www.leeyou.net/Temp/12.jpg"]http://www.leeyou.net/Temp/12.jpg[/url] [img]http://www.leeyou.net/Temp/12.jpg[/img] Line: a*x + b*y + c = 0; [url="http://www.leeyou.net/Temp/12.jpg"]http://www.leeyou.net/Temp/13.jpg[/url] [img]http://www.leeyou.net/Temp/13.jpg[/img] Bezier: p(t)= (1-t)^2 * p1 + 2 * t * (1-t) * p2 + t^2 * p3; //t >= 0 && t <= 1
  3. hehe, Sorry for my English. I can't express my meaning properly.[img]http://public.gamedev.net//public/style_emoticons/default/rolleyes.gif[/img] If I do it, Like this: [source lang="java"]var currentMission:Object = mission1;//this variable point at mission1 or mission1 or mission2 or mission3 function detectInitEnd(e:Event) { if(currentMission == null) { removeEventListener(Event.ENTER_FRAME, detectInitEnd) return; } if(mainChar.hero._image.hitTestObject(currentMission.leftLimit1)) { trace("left touched:" + currentMission); } else if(mainChar.hero._image.hitTestObject(currentMission.rightLimit2)) { mainChar.hero._image.x = 50 //restart hero's position , good if(Main._instanceMain.contains(currentMission)) { Main._instanceMain.removeChild(currentMission); //remove current level } var i:int = mission1.indexOf(currentMission); i ++; currentMission = i < mission1.length ? mission1[i] : null; if(currentMission != null) { Main._instanceMain.addChild(currentMission); } mainChar.hero._curRoom = currentMission != null ? "room" + i : ""; } }[/source]
  4. Can you paste the code? [img]http://public.gamedev.net//public/style_emoticons/default/rolleyes.gif[/img] Sorry. I did not understand all of your post.
  5. Hi. try this; ....... Main._instaceMain.addChild(charObject._image) // The _instanceMain is an instance I created in the Main.as to make everything work there Main._instaceMain.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed); //I tried Main._instanceMain. ... and stage, , but the same, doesn't work [b]Main._instaceMain.addEventListener(MouseEvent.MOUSE_DOWN, function(e:Event):void[/b] [b]{[/b] [b] stage.focus = Main._instaceMain;[/b] [b]});[/b] function keyPressed(event:KeyboardEvent) ..............
  6. c++ byte arrays how to output

    Hi. improve your sample code: for(int a = 0; a < size; ++a) { int p = *(data + a);// or int p = data[a]; cout << p; }