mirror of
				https://github.com/Klagarge/PokeHES.git
				synced 2025-11-04 05:09:18 +00:00 
			
		
		
		
	a
This commit is contained in:
		@@ -6,8 +6,6 @@ public class Enemy extends Character{
 | 
			
		||||
 | 
			
		||||
    private String branch;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    public Enemy(String name, int x, int y, String img, String map, int pv, String branch) {
 | 
			
		||||
        super(name, x, y, img, map);
 | 
			
		||||
        //generate his text
 | 
			
		||||
@@ -19,8 +17,6 @@ public class Enemy extends Character{
 | 
			
		||||
        this.branch = branch;
 | 
			
		||||
 | 
			
		||||
        this.pv = pv;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setPosition(int x, int y, String map){
 | 
			
		||||
 
 | 
			
		||||
@@ -31,14 +31,12 @@ public class ScreenBattle extends RenderingScreen{
 | 
			
		||||
	public void onInit() {
 | 
			
		||||
        //display the question
 | 
			
		||||
		generateFont("resources/font/Ubuntu-Regular.ttf", 30, Color.BLACK);
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public void onGraphicRender(GdxGraphics g) {
 | 
			
		||||
		g.clear(Color.BLACK);
 | 
			
		||||
 | 
			
		||||
		displayDialog(g);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -14,10 +14,63 @@ import java.util.RandomAccess;
 | 
			
		||||
class testYann{
 | 
			
		||||
    public static void main(String[] args) {
 | 
			
		||||
 | 
			
		||||
        FightData t = new FightData("enemi");
 | 
			
		||||
        t.readFile();
 | 
			
		||||
        
 | 
			
		||||
        String line = "Je vais te manger tout cru, dans le creux de ma main et tu verra rien du tout.";
 | 
			
		||||
        String cutLine = "";
 | 
			
		||||
        String newLine = "";
 | 
			
		||||
 | 
			
		||||
        System.out.println(t.getAttack(1).getAnswer(0).toString());
 | 
			
		||||
        int cut = 25;
 | 
			
		||||
 | 
			
		||||
        int startC = 0;
 | 
			
		||||
        int stoppC = cut;
 | 
			
		||||
        
 | 
			
		||||
 | 
			
		||||
        char[] c = new char[line.length()];
 | 
			
		||||
 | 
			
		||||
        for(int i=0; i<c.length;i++){
 | 
			
		||||
            c[i] = line.charAt(i);
 | 
			
		||||
        }
 | 
			
		||||
        System.out.println("start\n");
 | 
			
		||||
 | 
			
		||||
        while(true){
 | 
			
		||||
 | 
			
		||||
            for(int i =stoppC; i>=startC; i--){
 | 
			
		||||
                if(c[i] == ' '){
 | 
			
		||||
                    stoppC = i;
 | 
			
		||||
                    break;
 | 
			
		||||
                }
 | 
			
		||||
                else if(stoppC == c.length-1){
 | 
			
		||||
                    break;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            //découper le mot 
 | 
			
		||||
            for(int i=startC;i<=stoppC;i++){
 | 
			
		||||
                cutLine += c[i];
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            newLine += "\n" + cutLine;
 | 
			
		||||
            cutLine = "";
 | 
			
		||||
 | 
			
		||||
            startC = stoppC + 1;
 | 
			
		||||
 | 
			
		||||
           
 | 
			
		||||
            if(c.length-1-stoppC <=0){
 | 
			
		||||
                break;
 | 
			
		||||
            }
 | 
			
		||||
            else if(c.length-1-stoppC <= 10){
 | 
			
		||||
                stoppC = c.length-1;
 | 
			
		||||
            }
 | 
			
		||||
            else{
 | 
			
		||||
                stoppC += cut;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        System.out.println(newLine);
 | 
			
		||||
 | 
			
		||||
        
 | 
			
		||||
 | 
			
		||||
        
 | 
			
		||||
       
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user