Character movement according to map?

hi guys
in my game there is a player(Actor) and the player is standing on a horizontally mapped tile...
my problem is i just want to move the player according to the tiles . the player is a set of frames using drawRegion i am drawing that player ..when i press right key he has to move right in a position wise manner
any pls give me a solution
***********here is my code***************
import javax.microedition.lcdui.*;
import javax.microedition.lcdui.game.*;
public class ExampleGameCanvas extends GameCanvas implements Runnable
private boolean isPlay; // Game Loop runs when isPlay is true
private long delay=8; // To give thread consistency
private int k;
private int counter=0;
private int xpos=50;
private int ypos=60;
private byte ROTATE_NONE = Sprite.TRANS_NONE;
private byte ROTATE_90 = Sprite.TRANS_ROT90;
private byte ROTATE_180= Sprite.TRANS_ROT180;
private byte ROTATE_270= Sprite.TRANS_ROT270;
private byte CURRENT_ROTATE=ROTATE_NONE;
private Image clwalk;
private Image tilesImg,bottomboard,clownIdle; //Image varibale declaration-kris
private int clwalkXstart=0;
private int clnX=0;
private int tileXPos = 0;
private int tileYPos = 150;
private byte tileWidth = 21;
private byte tileHeight = 21;
private int tileStartXPosition = 0;
private int tileStartYPosition = 0;
private int numberOfRows = 12;
private int numberOfColumns = 11;
private int tileStartY = 39;
private int sampleMap[][] = {
//1, 2, 3, 4, 5, 6, 7, 8, 9,10,11
{-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
{-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
{-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
{-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, //11x12
{-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
{-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
{-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
{-1,-1,-1,-1, 1,-1,-1,-1,-1,-1,-1},
{-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
{-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, //-1 for empty space
{0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0} //0 for square tile
private int current_Map[][] = new int[numberOfRows][numberOfColumns]; //this will store the current level
// Constructor and initialization
public ExampleGameCanvas()
super(true);
try
tilesImg = Image.createImage("/tiles_240x320.png");
bottomboard = Image.createImage("/bottomboard_240x320.png");
clwalk = Image.createImage("/cl_walk_240x320.png");
}catch(Exception ee){}
// Automatically start thread for game loop
public void start()
isPlay = true;
Thread t = new Thread(this);
t.start();
// Main Game Loop
public void run()
Graphics g = getGraphics();
while (isPlay == true)
input();
drawMap(g);
drawPlayer(g);
try { Thread.sleep(delay); }
catch (InterruptedException ie) {}
// Method to Handle User Inputs
private void input()
int keyStates = getKeyStates();
// Right
if ((keyStates & RIGHT_PRESSED) !=0 )
System.out.println("bbbbbbbbbbbbbbbbbbbbbbbbbbbb");
clnX=clnX+2;
else if ((keyStates & LEFT_PRESSED) !=0 )
System.out.println("1111111111111111111111111111111111");
clnX=clnX-2;
private void drawMap(Graphics g)
System.out.println("jjjjjjjjjjjjjjjjjjjjjjj");
System.out.println("oooooooooooooooooooo");
g.setClip(0, 0, getWidth(), getHeight());
g.drawImage(bottomboard, 0, getHeight()-bottomboard.getHeight(), 0);
current_Map=sampleMap;
for(byte row = 0; row < numberOfRows; row++)
for(byte col =0; col < numberOfColumns; col++)
switch(current_Map[row][col])
case 0:
g.drawRegion(tilesImg, tileStartXPosition, tileStartYPosition, tileWidth, tileHeight, ROTATE_NONE, tileXPos,220, Graphics.TOP|Graphics.LEFT);
break;
if(tileXPos < 215)
tileXPos += tileWidth;
else
tileXPos = 5;
if(row >= 11)
tileYPos = tileStartY;
else
tileYPos += tileHeight;
// repaint();
// flushGraphics();
private void drawPlayer(Graphics g)
g.setColor(0xffffff);
g.fillRect(0,0,getWidth(),155+clwalk.getHeight());
g.drawRegion(clwalk,clwalkXstart, 0, 26, 41, ROTATE_NONE, clnX,180, Graphics.TOP|Graphics.LEFT);
clwalkXstart=clwalkXstart+26;
if(clwalkXstart==390)
clwalkXstart=0;
flushGraphics();
repaint();
thanks in advance

So, do you want to make a walking character that is not allowed to run through walls, or do you want the character to move automatically, so that it chooses an empty space that is on the side at an arbitrary height ?
If the first thing is what you mean, then this is how I do it: before I try and move a character, I first check if the position it should move into is free. If it is, that is, if no tile is in the way, the motion is granted/allowed.
Pseudocode:
If Key(LEFT)
     If (Character can move to left) { Move character to left }
     If (Character can move to right) { Move character to right }
}As for gravity and jumping, I use this:
Pseudocode:
If (jump > 0)
    jump = jump - 1
    *Move character upwards, if allowed*
Else
    If (*Character can move downwards*)
         *Move character downwards*
    ElseIf Key(SPACE)
          jump = 150
}

Similar Messages

  • Multiuser character movement synchronization

    hello
    am working on a multi player game in flash cs3 and FMS 3.5,
    user can register, select their characters (small movieclips
    i have only one at this time and that is Fairy) and then login to
    game.
    every person can see character of all online users at his/her
    screen with username popped up at the head of characters.
    user can move his/her character on screen using arrow keys of
    keyboard but their movement is not synchronized and visible to all
    users. i want to synchronize character movements at all screens
    simultaneously.
    any positive response or help will be highly appreciated..
    regards
    maani

    I think the best manner to accomplish something like this
    would be with a shared object. Put each user in their own slot in
    the shared object with an x,y for their position.
    A shared object should update relatively quickly, but you
    could always use a sharedobject.setDirty() if performance isn't
    real time enough for you.

  • Character translation error in Mapping Lookup API (RFC)

    Dear all,
    I am new to XI and got a question concerning XI Mapping Lookup API - I send an RFC Request, which comes back as RFC Response(XML), that I fill in a String to map on.
    My problem is, characters such as "Ä,ä,Ü,ß" and so on come back pretty weird and I also got a lot of quotes in my String. Could somebody please give me a hint how to move on with this..
    thanx in advance
    P.S. Is it usefull to handle this problem using the DOM Parser instead holding the response in a string? 
    Info: called system is R/3 4.6b, XI runs on 6.4 SR 16

    Dear all - thanks for your very fast help but I still have problem with the wrong character...
    @Michal - Using this coding (the easiest way, I found from the WebLog) to convert the Payload type to String, delivers the result I have  shown at the end,  so could you give me please some approach how to handle this
                   Payload resultOfCall = accessor.call(payload);
                   InputStream in = resultOfCall.getContent();
                   out = new ByteArrayOutputStream(1024);
                   byte[] buffer = new byte[1024];
                   for (int read = in.read(buffer); read > 0; read = in.read(buffer)) {
                        out.write(buffer, 0, read);
                   content = out.toString();
                   return content;
    Result:
    &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;rfc:Z_GETFTXC108TXTFROMFILE2.Response xmlns:rfc=&quot;urn:sap-com:document:sap:rfc:functions&quot;&gt;&lt;SCENOEDITXTSTRUCT&gt;&lt;MANDT&gt;030&lt;/MANDT&gt;&lt;SCENARIOID&gt;TVPN&lt;/SCENARIOID&gt;&lt;FILENAME&gt;/usr/sap/text3.txt&lt;/FILENAME&gt;&lt;FILETYPE&gt;ASC&lt;/FILETYPE&gt;&lt;TEXT1&gt;Kleines Regengesicht  aaLlMmNnOoPpQqRrSsTtUuVvWwXxYyZzÃ&#159;Ã&#159;Ã&#132;äÃ&#156;ü2 AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZzÃ&#159;Ã&#159;Ã&#132;äÃ&#156;ü3 AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZzÃ&#159;Ã&#159;1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678906 AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZzÃ&#159;Ã&#159;Ã&#132;äÃ&#156;ü3 AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZzÃ&#159;Ã&#159;8 AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZzÃ&#159;Ã&#159;Ã&#156;üÃ&#150;ö9 Ã&#132;äBbCcDdEeFfGgÃ&#150;öIxxSTRINGENDE&lt;/TEXT1&gt;&lt;TEXT2&gt;2 AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZzÃ&#159;Ã&#159;Ã&#132;äÃ&#156;ü1234567890123456789012345678901234567890123456789012345678903 AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZzÃ&#159;Ã&#159;1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678902 AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZzÃ&#159;Ã&#159;Ã&#132;äÃ&#156;ü7 Ã&#132;äBbCcDdEeFfGgHhIiJjKkLlMmNnÃ&#150;öPpQqRrSsTtÃ&#156;üVvWwXxYyZzÃ&#159;Ã&#159;Ã&#150;öÃ&#156;ü8 AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZzÃ&#159;Ã&#159;Ã&#156;üÃ&#150;ö9 Ã&#132;äBbCcDdEeFfGgÃ&#150;öIxxSTRINGENDE&lt;/TEXT2&gt;&lt;TEXT3&gt;3 AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZzÃ&#159;Ã&#159;Kleines Regengesicht  aaLlMmNnOoPpQqRrSsTtUuVvWwXxYyZzÃ&#159;Ã&#159;Ã&#132;äÃ&#156;ü3 AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZzÃ&#159;Ã&#159;1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678906 AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZzÃ&#159;Ã&#159;Ã&#132;äÃ&#156;ü7 Ã&#132;äBbCcDdEeFfGgHhIiJjKkLlMmNnÃ&#150;öPpQqRrSsTtÃ&#156;üVvWwXxYyZzÃ&#159;Ã&#159;Ã&#150;öÃ&#156;ü8 AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZzÃ&#159;Ã&#159;Ã&#156;üÃ&#150;ö9 Ã&#132;äBbCcDdEeFfGgÃ&#150;öIxxSTRINGENDE&lt;/TEXT3&gt;&lt;TEXT4&gt;7 Ã&#132;äBbCcDdEeFfGgHhIiJjKkLlMmNnÃ&#150;öPpQqRrSsTtÃ&#156;üVvWwXxYyZzÃ&#159;Ã&#159;Ã&#150;öÃ&#156;ü7 Ã&#132;äBbCcDdEeFfGgHhIiJjKkLlMmNnÃ&#150;öPpQqRrSsTtÃ&#156;üVvWwXxYyZzÃ&#159;Ã&#159;Ã&#150;öÃ&#156;ü2 AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZzÃ&#159;Ã&#159;Ã&#132;äÃ&#156;ü123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890Kleines Regengesicht  aaLlMmNnOoPpQqRrSsTtUuVvWwXxYyZzÃ&#159;Ã&#159;Ã&#132;äÃ&#156;ü1234567890123456789012345678901234567890123456789012345678908 AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZzÃ&#159;Ã&#159;Ã&#156;üÃ&#150;ö9 Ã&#132;äBbCcDdEeFfGgÃ&#150;öIxxSTRINGENDE&lt;/TEXT4&gt;&lt;TEXT5&gt;&lt;/TEXT5&gt;&lt;/SCENOEDITXTSTRUCT&gt;&lt;/rfc:Z_GETFTXC108TXTFROMFILE2.Response&gt;
    Thnaks in advance!

  • Unsported character error in message mapping

    I use a sender mail adapter to read an xml and then map it to another message type. Most of the time, it's ok. But when there are some special German character such as ö ä ß, then I get the "unsuported character" error.
    Anyone could help?
    thanks!
    com.sap.engine.lib.xml.parser.ParserException: Unsupported character: 32(:main:, row:11, col:14) at com.sap.engine.lib.xml.parser.readers.EncodedDataReader.read(EncodedDataReader.java:207) at com.sap.engine.lib.xml.parser.readers.EncodedDataReader.read(EncodedDataReader.java:205) at com.sap.engine.lib.xml.parser.helpers.AdvancedXMLStreamReader.read(AdvancedXMLStreamReader.java:143) at com.sap.engine.lib.xml.parser.XMLParser.scanCharData(XMLParser.java:2000) at com.sap.engine.lib.xml.parser.XMLParser.scanContent(XMLParser.java:2445) at com.sap.engine.lib.xml.parser.XMLParser.scanElement(XMLParser.java:1841) at com.sap.engine.lib.xml.parser.XMLParser.scanContent(XMLParser.java:2440) at com.sap.engine.lib.xml.parser.XMLParser.scanElement(XMLParser.java:1841) at com.sap.engine.lib.xml.parser.XMLParser.scanContent(XMLParser.java:2440) at com.sap.engine.lib.xml.parser.XMLParser.scanElement(XMLParser.java:1841) at com.sap.engine.lib.xml.parser.XMLParser.scanContent(XMLParser.java:2440) at com.sap.engine.lib.xml.parser.XMLParser.scanElement(XMLParser.java:1841) at com.sap.engine.lib.xml.parser.XMLParser.scanDocument(XMLParser.java:2843) at com.sap.engine.lib.xml.parser.XMLParser.parse0(XMLParser.java:229) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parseAndCatchException(AbstractXMLParser.java:145) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:160) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:261) at com.sap.engine.lib.xml.parser.Parser.parseWithoutSchemaValidationProcessing(Parser.java:280) at com.sap.engine.lib.xml.parser.Parser.parse(Parser.java:342) at com.sap.engine.lib.xml.parser.SAXParser.parse(SAXParser.java:125) at javax.xml.parsers.SAXParser.parse(SAXParser.java:345) at com.sap.aii.mappingtool.tf3.rt.xparser.MTSaxHandler.run(MTSaxHandler.java:155) at com.sap.aii.mappingtool.tf3.rt.xparser.XParser.run(XParser.java:73) at java.lang.Thread.run(Thread.java:534) -
    at com.sap.engine.lib.xml.parser.SAXParser.parse(SAXParser.java:144) at javax.xml.parsers.SAXParser.parse(SAXParser.java:345) at com.sap.aii.mappingtool.tf3.rt.xparser.MTSaxHandler.run(MTSaxHandler.java:155) at com.sap.aii.mappingtool.tf3.rt.xparser.XParser.run(XParser.java:73) at java.lang.Thread.run(Thread.java:534) Caused by: com.sap.engine.lib.xml.parser.ParserException: Unsupported character: 32(:main:, row:11, col:14) at com.sap.engine.lib.xml.parser.readers.EncodedDataReader.read(EncodedDataReader.java:207) at com.sap.engine.lib.xml.parser.readers.EncodedDataReader.read(EncodedDataReader.java:205) at com.sap.engine.lib.xml.parser.helpers.AdvancedXMLStreamReader.read(AdvancedXMLStreamReader.java:143) at com.sap.engine.lib.xml.parser.XMLParser.scanCharData(XMLParser.java:2000) at com.sap.engine.lib.xml.parser.XMLParser.scanContent(XMLParser.java:2445) at com.sap.engine.lib.xml.parser.XMLParser.scanElement(XMLParser.java:1841) at com.sap.engine.lib.xml.parser.XMLParser.scanContent(XMLParser.java:2440) at com.sap.engine.lib.xml.parser.XMLParser.scanElement(XMLParser.java:1841) at com.sap.engine.lib.xml.parser.XMLParser.scanContent(XMLParser.java:2440) at com.sap.engine.lib.xml.parser.XMLParser.scanElement(XMLParser.java:1841) at com.sap.engine.lib.xml.parser.XMLParser.scanContent(XMLParser.java:2440) at com.sap.engine.lib.xml.parser.XMLParser.scanElement(XMLParser.java:1841) at com.sap.engine.lib.xml.parser.XMLParser.scanDocument(XMLParser.java:2843) at com.sap.engine.lib.xml.parser.XMLParser.parse0(XMLParser.java:229) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parseAndCatchException(AbstractXMLParser.java:145) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:160) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:261) at com.sap.engine.lib.xml.parser.Parser.parseWithoutSchemaValidationProcessing(Parser.java:280) at com.sap.engine.lib.xml.parser.Parser.parse(Parser.java:342) at com.sap.engine.lib.xml.parser.SAXParser.parse(SAXParser.java:125) ... 4 more com.sap.engine.lib.xml.parser.ParserException: Unsupported character: 32(:main:, row:11, col:14) at com.sap.engine.lib.xml.parser.readers.EncodedDataReader.read(EncodedDataReader.java:207) at com.sap.engine.lib.xml.parser.readers.EncodedDataReader.read(EncodedDataReader.java:205) at com.sap.engine.lib.xml.parser.helpers.AdvancedXMLStreamReader.read(AdvancedXMLStreamReader.java:143) at com.sap.engine.lib.xml.parser.XMLParser.scanCharData(XMLParser.java:2000) at com.sap.engine.lib.xml.parser.XMLParser.scanContent(XMLParser.java:2445) at com.sap.engine.lib.xml.parser.XMLParser.scanElement(XMLParser.java:1841) at com.sap.engine.lib.xml.parser.XMLParser.scanContent(XMLParser.java:2440) at com.sap.engine.lib.xml.parser.XMLParser.scanElement(XMLParser.java:1841) at com.sap.engine.lib.xml.parser.XMLParser.scanContent(XMLParser.java:2440) at com.sap.engine.lib.xml.parser.XMLParser.scanElement(XMLParser.java:1841) at com.sap.engine.lib.xml.parser.XMLParser.scanContent(XMLParser.java:2440) at com.sap.engine.lib.xml.parser.XMLParser.scanElement(XMLParser.java:1841) at com.sap.engine.lib.xml.parser.XMLParser.scanDocument(XMLParser.java:2843) at com.sap.engine.lib.xml.parser.XMLParser.parse0(XMLParser.java:229) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parseAndCatchException(AbstractXMLParser.java:145) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:160) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:261) at com.sap.engine.lib.xml.parser.Parser.parseWithoutSchemaValidationProcessing(Parser.java:280) at com.sap.engine.lib.xml.parser.Parser.parse(Parser.java:342) at com.sap.engine.lib.xml.parser.SAXParser.parse(SAXParser.java:125) at javax.xml.parsers.SAXParser.parse(SAXParser.java:345) at com.sap.aii.mappingtool.tf3.rt.xparser.MTSaxHandler.run(MTSaxHandler.java:155) at com.sap.aii.mappingtool.tf3.rt.xparser.XParser.run(XParser.java:73) at java.lang.Thread.run(Thread.java:534) -
    at com.sap.engine.lib.xml.parser.SAXParser.parse(SAXParser.java:144) at javax.xml.parsers.SAXParser.parse(SAXParser.java:345) at com.sap.aii.mappingtool.tf3.rt.xparser.MTSaxHandler.run(MTSaxHandler.java:155) at com.sap.aii.mappingtool.tf3.rt.xparser.XParser.run(XParser.java:73) at java.lang.Thread.run(Thread.java:534) Caused by: com.sap.engine.lib.xml.parser.ParserException: Unsupported character: 32(:main:, row:11, col:14) at com.sap.engine.lib.xml.parser.readers.EncodedDataReader.read(EncodedDataReader.java:207) at com.sap.engine.lib.xml.parser.readers.EncodedDataReader.read(EncodedDataReader.java:205) at com.sap.engine.lib.xml.parser.helpers.AdvancedXMLStreamReader.read(AdvancedXMLStreamReader.java:143) at com.sap.engine.lib.xml.parser.XMLParser.scanCharData(XMLParser.java:2000) at com.sap.engine.lib.xml.parser.XMLParser.scanContent(XMLParser.java:2445) at com.sap.engine.lib.xml.parser.XMLParser.scanElement(XMLParser.java:1841) at com.sap.engine.lib.xml.parser.XMLParser.scanContent(XMLParser.java:2440) at com.sap.engine.lib.xml.parser.XMLParser.scanElement(XMLParser.java:1841) at com.sap.engine.lib.xml.parser.XMLParser.scanContent(XMLParser.java:2440) at com.sap.engine.lib.xml.parser.XMLParser.scanElement(XMLParser.java:1841) at com.sap.engine.lib.xml.parser.XMLParser.scanContent(XMLParser.java:2440) at com.sap.engine.lib.xml.parser.XMLParser.scanElement(XMLParser.java:1841) at com.sap.engine.lib.xml.parser.XMLParser.scanDocument(XMLParser.java:2843) at com.sap.engine.lib.xml.parser.XMLParser.parse0(XMLParser.java:229) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parseAndCatchException(AbstractXMLParser.java:145) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:160) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:261) at com.sap.engine.lib.xml.parser.Parser.parseWithoutSchemaValidationProcessing(Parser.java:280) at com.sap.engine.lib.xml.parser.Parser.parse(Parser.java:342) at com.sap.engine.lib.xml.parser.SAXParser.parse(SAXParser.java:125) ... 4 more

    As the mail server provides the correct encoding, the MessageTransformBean does the conversion to UTF-8.
    If the encoding was not set by the mail server, then the MessageTransformBean would only set the content type, but not do any conversion.
    When you are not sure, if the content type is by the mail server, you can apply the MessageTransformBean twice: First with iso-8859-1, second with UTF-8
    I am not sure, why the mapping tool cannot do the conversion, but I think this is because the content type is not application/xml. But this is only a guess.
    What happens, when you only apply the MessageTransformBean, but do not change the XML encoding?

  • Character encoding in Seeburger mapping

    Hello all,
    In my EDI project, i use Seebruger EDI Adapter.
    We have discover a problem when you use french character has é, è, à, etc... In fact, Seeburger see the "é" has A@A, it convert the letter so when we arrive in the bic mapping of seeburger it crash down because for him, the field is too long.
    exemple :
    Field 1 after integration engine (limit on 4 characters in bic mapping) : éert
    Field 1 interpreted by seeburger : A@Aert => so we are above the authorized limit.
    I know that we send message in UTF-8 but i am a little bit surprise that Seeburgerr doesn't read UTF-8.
    Is someone has an idea ?
    Regards,
    JP

    Hi,
    Well, you could use a JavaMapping logic to correct that, but if you want it to do it with seeburger tools for that cases you need to use the module ReplaceString in seeburger:
    In the "Module" option of the channel, you have 2 parameters, "Processing Sequence" and "Module Configuration"
    There you need to do the following:
    Processing Sequence:
    Module name: localejbs/Seeburger/ReplaceString
    Module Type: Local Enterprise Bean
    Module Key: 1 <= key for calling that sequence
    Module Configuration:
    Module Key: 1
    Parameter Name: searchString
    Parameter Value: "à" <= search value
    Module Key: 1
    Parameter Name: replaceString
    Parameter Value: "a" <= replace with
    You would need to do that for every character you have, when you save the order would probably change leaving replace first instead of search, but i'll work anyway, that doesn't affect anything
    Hope you find that helpful,
    Regards,

  • Game character movement

    Hi,
    I've got a system were I have constants for each of the compose points, and using a switch on that direction:
    For example, if north - speed from y, is east + x, and so on.
    This seems to work well, but I've always wanted to use degrees for the direction, rather then constants.
    I've made a little image to show what I'm after, for some reason my browser was being redirected when trying to view it, so I've made a little html to display it and can be found here: http://acquiesce.awardspace.co.uk/temp/viewImg.html
    In actual fact, the example i have there would be the equivalent of north-east in my current system.
    I've also put what I've done so far, http://acquiesce.awardspace.co.uk/temp/MovementTester.java, the sheep.png is on the viewImg, just save as target.
    I had this idea of having an up vector (Line2D), this vector could then be rotated by the characters direction to get a new line, then, say speed was 10, 10 units up this line would be the new position for the character.
    Does that make sense to people?
    I guess the only thing left to do is get the new pos that's 10 (or whatever speed is) units up the direction line, but I have no idea, how to do this.
    Can anyone add any thoughts? I remember doing something like this before, so I'll see what I can think of.
    Thanks,
    Luke

    I do make my life needlessly complicated at times.
    All i needed to do was change the length of the up line, so what was all this talk about circles and points on a circumference? I don't know... Anyway, here;s what I've ended up with, the sprite (sheep) follows the mouse around when moved:
    import java.io.File;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.awt.geom.*;
    import javax.swing.JFrame;
    import javax.imageio.*;
    public class MovementTester extends JFrame implements
    MouseMotionListener,MouseWheelListener
         public static void main(String[] args) {new MovementTester();}
         // The point were the sheep is to be drawn
         private Point2D pos=null;
         // The sheep direction (in degrees)
         private double dir=45;
         // The speed the sheep is to move
         private double speed=10;
         // Face the direction
         private boolean faceDir=true;
         // The centre of the sheep
         private Point2D sheepCentre=null;
         // The sheep
         private BufferedImage sheep=null;
         // The up vector
         private Point2D up=null;
         // The centre of the frame
         private Point2D centre=null;
         public MovementTester()
              this.setSize(800,600);
              // Setup the sheep
              setupSheep();
              // Set the centre
              centre=new Point2D.Double(this.getWidth()/2,this.getHeight()/2);
              // Add the mouse thingys
              this.addMouseMotionListener(this);
              this.addMouseWheelListener(this);
              this.setDefaultCloseOperation(EXIT_ON_CLOSE);
              this.setVisible(true);
         private void setupSheep()
              try {
                   sheep=ImageIO.read(new File("tester\\Images\\sheep.png"));
              } catch (Exception ex) {ex.printStackTrace();}
              // Draw in the middle
              double x=(this.getWidth()/2)-(sheep.getWidth()/2);
              double y=(this.getHeight()/2)-(sheep.getHeight()/2);
              pos=new Point2D.Double(x,y);
         public void paint(Graphics g)
              //super.paint(g);
              // The buffer
              BufferedImage buff=new BufferedImage(this.getWidth(),this.getHeight(),
                        BufferedImage.TYPE_4BYTE_ABGR_PRE);
              // Get the buff g
              Graphics2D buffG=(Graphics2D)buff.getGraphics();
            if (isOpaque()) { //paint background
                 buffG.setColor(getBackground());
                 buffG.fillRect(0, 0, getWidth(), getHeight());
              // The up vector (sheep x and y - speed)
              up=new Point2D.Double(pos.getX(),pos.getY()-speed);
              // The up line from sheep to up
              Line2D upLine=new Line2D.Double(pos,up);
              // The direction line
              Line2D dirLine=null;
              // Draw the up line in blue
              buffG.setPaint(Color.blue);
              buffG.draw(upLine);
              // Roate the up line
              AffineTransform alf=AffineTransform.getRotateInstance(
                        Math.toRadians(dir),upLine.getX1(),upLine.getY1()
              // Get the transformed shaoe as a line
              dirLine=toLine(alf.createTransformedShape(upLine));
              // Draw the direction line in red
              buffG.setPaint(Color.red);
              buffG.draw(dirLine);
              // Move to end of the dir line
              pos=new Point2D.Double(dirLine.getX2(),dirLine.getY2());
              // The centre of the sheep
              sheepCentre=new Point2D.Double(pos.getX()+(sheep.getWidth()/2),
                        pos.getY()+(sheep.getHeight()/2));
              // If face dir
              if (faceDir)
                   // Rotate to dir
                   //sheep=rotate(sheep,dir,pos.getX(),pos.getY(),null);
    //           Draw the sheep
              buffG.drawImage(sheep,(int)pos.getX(),(int)pos.getY(),null);
              // Draw the buff
              g.drawImage(buff,0,0,null);
         public void mouseMoved(MouseEvent e)
              // Get the mouse x,y
              double mX=e.getPoint().getX();
              double mY=e.getPoint().getY();
              // Make a point at the top middle of the frame
              Point2D top=new Point2D.Double(centre.getX(),0);
              // The dist of top to centre (side a)
              double sideA=Point.distance(top.getX(),top.getY(),
                        centre.getX(),centre.getY());
              // The dist pf centre to mouse point (side b)
              double sideB=Point.distance(centre.getX(),centre.getY(),
                        mX,mY);
              // Between mouse and top (side c)
              double sideC=Point.distance(mX,mY,top.getX(),top.getY());
              // We wanna find the angle abound the centre
              // So the cos of angleCen
              double cosCen=((sideA*sideA)+(sideB*sideB)-(sideC*sideC))/(
                        2*(sideA*sideB));
              // Arc cos to get angle
              dir=Math.toDegrees(Math.acos(cosCen));
              // If mouse is on left side of centre
              if (mX<centre.getX())
                   // - from 360 to get the reverse angle
                   dir=360-dir;
              // Repaint
              repaint();
         public void mouseDragged(MouseEvent e) {}
         public void mouseWheelMoved(MouseWheelEvent e)
              // If up (away)
              if (e.getWheelRotation()<0)
                   // More speed
                   speed=speed+4;
              else {speed=speed-4;}
         public static BufferedImage rotate(BufferedImage in,double angle,
                   double x,double y,RenderingHints rh)
              AffineTransform aff = AffineTransform.getRotateInstance(angle,x,y);
              // The transform op
              AffineTransformOp op = new AffineTransformOp(aff,rh);
              // Return the rotated bufferedImage
              return op.filter(in,null);
         public static Line2D toLine(Shape s)
              return toLine(s.getPathIterator(null));
         public static Line2D toLine(PathIterator path)
              // The line
              Line2D line=null;
              // The start of the line
              Point2D start=null;
              // The end of the line
              Point2D end=null;
              // Two points (x1,y1,x2,y2)
              double[] points=new double[2];
              // Get the first segment, should be move to and the stat of the line
              path.currentSegment(points);
              // Make the start point
              start=new Point2D.Double(points[0],points[1]);
              // Move to the next segment
              path.next();
              // Get the next segment, line to and the end point
              path.currentSegment(points);
              // Make the end point
              end=new Point2D.Double(points[0],points[1]);
              // Make the line
              line=new Line2D.Double(start,end);
              // Return the line
              return line;
    }I thought it would be cool if the image rotated to face the direction it's moving in, but when I tried that using the AffineTransformOp I got a RasterFormatException.
    I've had problems with op's and image loaded using the ImageIO.read() before, but they work fine loaded from the JPEGDecoder ???
    Guess I'll have to make a PNGDecoder next :|
    Anyway, I'm happy for the time being watching my sheep dance about. :D
    Luke

  • Character Movement

    In the game I'm doing, the character can move in six directions by pressing the individual individual arrow keys, or press two at a time for the intermidiate direction. When you're not pressing any keys, the character stays still, facing the direction that he was last traveling. At first I thought to have four booleans, one for each key, and to have an integer that represented the direction for when no keys are pressed. The problem with this is that when you release the keys, you usally don't release them exactly at the same time, so the character will face the direction of the key last pressed. Does anyone know of a better way to do this?

    Okay. In the keyReleased(KeyEvent e) method I would have a variable that checked the time between releases, if they are within 50 mm of each other don't record the new direction. if you don't understand I will give a code snippet.

  • Character movement needs fine tuning

    This the code to move my hero mc around the screen.
    However, when you click directly under or over the mc it doesn't move. When I say directly above I mean the angle not the distance. ie: I am well above the mc but it doesn't move.
    Little kids are going to play this and it needs to be more responsive or they get frustrated.
    var speed:Number=.99;
    public function onEnterFrame(event:Event):void {
    var xDistance:Number=clickPoint.x-this.hero.x;
    var yDistance:Number=clickPoint.y-this.hero.y;
    if (Math.abs(xDistance)>10) {
    var angle:Number=Math.atan2(yDistance,xDistance);
    this.hero.x+=v*Math.cos(angle);
    this.hero.y+=v*Math.sin(angle);
    } else {
    this.hero.gotoAndPlay("static");
    enemy1.x = speed*enemy1.x+(1-speed)*hero.x;
    enemy1.y = speed*enemy1.y+(1-speed)*hero.y;
    if (clickPoint.x>=hero.x) {
    this.hero.gotoAndPlay("right");
    //trace(Math.abs(xDistance));
    if (this.hero.x>=clickPoint.x) {
    this.hero.gotoAndPlay("left");
    //trace(Math.abs(xDistance));

    You're not moving because your x offset is less that your required 10 pixels.  So even though your y IS, you're not considering it.
    var xDistance:Number=clickPoint.x-this.hero.x;
    var yDistance:Number=clickPoint.y-this.hero.y;
    if (Math.abs(xDistance)>10) {
          var angle:Number=Math.atan2(yDistance,xDistance);
          this.hero.x+=v*Math.cos(angle);
          this.hero.y+=v*Math.sin(angle);
    } else...
    You need to caluculate the actual distance between the position of your character and the mouse click, not just on one axis.
    Try this:
    var distance:Number = Point.distance(new Point(clickPoint.x, clickPoint.y), new Point(this.hero.x, this.hero.y));
    if (Math.abs(distance) > 10) {
         var xDistance:Number=clickPoint.x-this.hero.x;
         var yDistance:Number=clickPoint.y-this.hero.y;
         var angle:Number=Math.atan2(yDistance,xDistance);
         this.hero.x+=v*Math.cos(angle);
         this.hero.y+=v*Math.sin(angle);
    } else {
         this.hero.gotoAndPlay("static");
    There's no need to calc the x and y distance if your total distance isn't enough to move your character, so just moved that into the conditional.
    Hope it helps.

  • Resize the captivate movie according to iframe dimensions.

    Hello, I have captivate interactive movie embedded inside iframe. When I see only the output, it looks perfect and resizes according to dimensions of browser window. But, when i embedd the movie into iframe its dimensions seems distorted as shown below. How do I make if responsive according to size of iframe?

    1. I will use (.fla) file source
    2. Put behavior sound o script AS3
    3. Refresh object in my Library Items
    Also I try convert swf to video flv and custom skin control sound video.

  • Character encoding according to page indication

    Hello.
    I'm not sure this forum is the better one to post such a question. Perhaps the Tomcat list could be another good place... So if someone has a better idea, it's welcome...
    I've tested how the JSP 2.0 processor generates, or not, character encodings, using a recent Tomcat 5.5.
    In a same page, with a content type defined in "text/xml" using a charset "UTF-8", i can use 3 equivalent forms to write out a character.
    1) the old scriptlet expression : <%=myAttribute%>2) The new EL form, directly put in the page body : ${myAttribute}3) The jstl solution : <c:out value="${myAttribute}"/>And the winner is :
    In (1) and (2), no special processing is done, and if my string contains any '<' , the generated document is mal formed... too bad !
    In (3), with the default use for encoding, the possible '<' or any other special character are converted to the correct xml entity... and the document wins !
    So... my question : in there a particular part of the (servlet + jsp + taglib + jstl + el) specifications that clearly explains how characters should or must be encoded by the server, and when this is the application responsability...
    Thanks for your help...

    If you want the list to be automatically updated as you edit, Obi-wan's 27 grep styles along with 27 swatches is the way to go.
    You could also do it with a script which would require less setup—the grep approach would need a paragraph style with 27 grep rules linked to 27 character styles using 27 swatches.
    This AppleScript (OSX only) picks up the first character of the paragraph and colors the paragraph text with a swatch named the same. So this short example uses uppercase A, B, C named swatches to color corresponding paragraphs starting with the same letter:
    tell application "Adobe InDesign CS6"
        --make sure there's a selection and get the text and its frame
        try
            set c to {insertion point, character, word, line, paragraph}
            if class of selection is in c then
                set t to parent of selection
            else if class of selection is text frame then
                set t to parent story of selection
            end if
        on error
            display dialog "Please select some text"
            return
        end try
        --get all of the story paragraphs
        set p to object reference of every paragraph of t
        --color each paragraph with the swatch that's named with the paragraph's first letter
        repeat with x in p
            set c to character 1 of x as string
            set s to (every swatch of active document whose name is c)
            try
                set fill color of every character of x to item 1 of s
            end try
        end repeat
    end tell

  • Character Movement + Rotation

    Hello,
    I am currently working on a car racing game but I am new to
    designing the engine for my game such as the physics for my car.
    So, I took help from a tutorial but could'nt quite understand the
    trigonometry part, can you explain it.
    The part I did not understand was,
    x = Math.sin(_rotation*(Math.PI/180))*speed;
    y = Math.cos(_rotation*(Math.PI/180))*speed*-1;
    if (!_root.hit.hitTest(_x+x, _y+y, true)) {
    _x += x;
    _y += y;
    } else {
    speed *= -.6;
    Hope you can help me out,
    Thanking You,
    Chinmaya
    P.S. I know how to convert degrees to radians and know a
    little about unit circles. The main part I dont understand is that
    why do we multiply the sin of angle(in radians) to the
    speed!

    I'm not sure if I understand. Do you just need to know why
    you are multiplying the speed or is there something that isn't
    working?
    The multiplication is easy. Basically you have some speed,
    let's say 5. Now if you are going perfectly to the right along the
    x axis then you have 5 in the x direction and you have 0 in the y
    direction.
    If you are going down the screen you have 5 in the y
    direction and 0 in the x direction. Easy.
    But what if you are going at some angle? That is when it gets
    a little more tricky. Well back to your lovely unit circle. If you
    speed was 1 we have the same issue for the x and y directions. But
    if you go off at an angle you've got your sin component in the x
    direction and your cos in the y direction. And there you go, cos(0)
    = 1 and sin(0) = 0 meaning at an angle of zero all your motion is
    in the x direction.
    So for a given angle cos shows the amount you've got in the x
    direction and sin shows the y direction. That way you can tell your
    object how many x and y to move and it looks like movement in at an
    angle. You multiply them because you aren't always using a unit
    circle.

  • Character movement with mouse click

    This will be for an MMO online game/ world. So it needs to be good.
    Hi guys. I'm really happy I got this to work as I'm a neebie to AS3 but getting to love its simplicity. My problem is not my AS3 but my maths.
    I click the mouse and the movieclip runs to the mouse's x position. However, it only goes in one direction ie: downwards and to the right.
    I need to it go in all directions depending on where I click. I suppose it has to do with comparing x and y positions of both mouse and mc - ie: if one is bigger than the other then you can tell where both are positioned and then put the code in. Am I right and does anybody hace a little code like this flying around for me?
    import flash.display.Stage;
    import flash.events.Event;
    stage.addEventListener(MouseEvent.CLICK, myClickReaction);
    function myClickReaction (e:MouseEvent):void{
        sunny.gotoAndPlay("runback")
        //sunny.x = root.stage.mouseX
        //sunny.y = root.stage.mouseY
        addEventListener(Event.ENTER_FRAME, onEnterFrame);
    function onEnterFrame(event:Event):void {
                 var xDistance:Number
                 var yDistance:Number
                //mc increments by 5 until it reaches mouse - mc (ie the distance)
                sunny.x += 5;
                sunny.y += 5;
                xDistance = root.stage.mouseX - sunny.x
                trace (xDistance)
                if (xDistance <= 0 ) {
                trace("works")
                sunny.gotoAndPlay("static")
                removeEventListener(Event.ENTER_FRAME, onEnterFrame);

    Thanks for contacting but the code more or less works already apart from the comments below.
    The position I get comparing mousex position and movieclip position. BUT it goes loopy when I move the mouse around. ie: I need the coordinates when I click and not a variable that changes while I move mouse around.
    I will check it out now.
    import flash.display.Stage;
    import flash.events.Event;
    stage.addEventListener(MouseEvent.CLICK, myClickReaction);
    function myClickReaction (e:MouseEvent):void{
    //sunny.x = root.stage.mouseX
    //sunny.y = root.stage.mouseY
    addEventListener(Event.ENTER_FRAME, onEnterFrame);
    function onEnterFrame(event:Event):void {
                 var xDistance:Number
        var yDistance:Number
       //mc increments by 5 until it reaches mouse - mc (ie the distance)
                // if you click to the right of sunny then mouse is > than sunny.x so x = 5
       if (root.stage.mouseX > sunny.x) {
        sunny.gotoAndPlay("walk right")
        sunny.x += 5;
        sunny.y += 0;
        xDistance = root.stage.mouseX - sunny.x
        //if (xDistance <= 0 ) {
        //sunny.gotoAndPlay("static")
        //removeEventListener(Event.ENTER_FRAME, onEnterFrame);

  • Making a line interactively move on a map clip

    You've seen how a map is shown on the page and then you see the line with an arrow superimposed on it to show the route traveled across the clip (I do want it to be interactive not just one line all at once from start to finish). Can anyone give me step by step on how to do this. Briefly I want to show the entire world and start from NY moving on to California then on to Asia etc. Wondering if Motion would come into play on this? FYI I'm familiar with FCP to the extent for what I do with it - that is to say I'm not an expert or even an advanced user and am well aware of the fact that I probably only use 25 percent of it's capabilities. Thanks

    Do you have iMovie? That is a built in feature. Click on the button for the Animatic Browser:
    Create your moving map, then export to FCP for use.
    Here is a low rez example:
    http://vimeo.com/31232175
    MtD

  • When I Change The Size Of A Text Box/Menu Widget, Other Objects Move According To It. How Do I Make It Stop?

    Example: There is a text box and there are objects below it. I add more text and  the text box size becomes bigger.
    Then the objects below move down.
    How do I make it stop happening?

    Hi LP700CR7,
    This is a default behavior, I am afraid, its not possible to stop this behavior at this stage within Muse.

  • Extended character shortcuts are mis-mapped

    When using any shortcut with A-Z only or spacebar, they work. When using extended characters such as [ and ] for brush size...doesn't work. Arrow keys for nudging doesn't work. Ctrl+C works, but Ctrl click on a layer doesn't make a selection, but Ctrl click on a channel does. This is a copy of Photoshop just installed at work. They ONLY buy legit copies.
    When I remap the [ it shows up as Û. And ] shows up as Ý. Language is set to US English. Keyboard is set to US English. Using CS2 on XP.
    Read many posts, no solutions, yet.
    Thanks!!!

    >.I got the answer from Adobe...the serial number is legit.
    >But, we found on the label that it is a copy from Singapore.
    again, that's very weird because that's another one of the signs of this high quality pirate stuff that's going around. apparently someone ripped the stuff right from the singapore factory stock and copied it. adobe telling you (via phone call? to a person? i believe the app is hacked to "activate" but that's part of the problem with the keys not working right) that it's legit makes it stranger because now we have a mix of signals. on the one hand it's a singapore copy that the shortcut keys don't work on, but adobe tells you it's ok.
    I think you need to get another copy of the app. if it's a large company, maybe you guys have another disk lying around? (hopefully one that doesn't have the made in singapore on it?)

Maybe you are looking for

  • Sales order and Billing Should be Block as per Customer Payment Terms

    When  credit limit exceeded to limits As per their client requirement in sales order level credit check has done and it will save , when they trying to do Delivery it is not possible to proceed. With out changing the credit master record they want to

  • After effect CS6 app 11.00 won't open with Maverick 10.9.4

    Hello, i have just finished updating all the applications on master creative suite but i get a window saying that i can't use this version of the application adobe after effects cs6 app with this version of osx. cld you pls advise what to do? thanks

  • Had to use the restore CD  HELP.

    I had some issues that forced me to use the restore cd so I lost alot of stuff including my original I tunes account and all my music. Can't I just download I tunes again and log in with my same name and pull up the music that was in it?? If I can't

  • Query not using the index

    Query SELECT case.case_objid FROM [email protected] case, table_x_cwp_tickect_details_vw t WHERE CASE.case_condition_cd IN ('OPEN', 'OPEN-DISPATCH', 'OPEN-REJECT', 'OPEN-RETURNED') AND case.case_type_cd in ('CUSTOMER FAULT', 'CHRONIC','SC

  • Converting a document containing RGB images to CMYK (with a profile)

    Hi, I am trying to use PDDocColorConvertPage to convert all RGB images in a PDF document to CMYK (with a color profile). I can see the API is performing some changes to the PDF however it is not performing the conversion in the same way as Photoshop