English 中文(简体)
为Evil Genius举办节目视频会:项目10:体育赛-音乐会
原标题:Programming Video Games for the Evil Genius:Project 10:Radical Racing-The Cars
  • 时间:2012-05-19 00:40:21
  •  标签:
  • java
  • video

“entergraph

Iv e 研究了本书的答复。 我知道,试图阅读这本书的其他人也感到同样。 它称为“Evil Genius电影运动会”。 是否有任何人读过这本书? I m on Project 10:Radical Say-The Cars. 所有材料都正确汇编,但出于某种原因,我的汽车没有在JFrame的正确地点展示。 他们应在两条白色线下展示。 我对《法典》持肯定态度,但该书是错误的。 我已经尝试改变起源地的健康权部分,但不管我做什么都不算。 我可以附上一个形象,因为我没有至少10个东西。 这是有关汽车安置的法典。

public class TheCars extends JFrame
{
final int WIDTH = 900; int HEIGHT = 650;

double p1Speed = .5, p2Speed = .5;


Rectangle p1 = new Rectangle(WIDTH/9,HEIGHT/2, WIDTH/30,WIDTH/30);


Rectangle p2 = new Rectangle(((WIDTH/9)+((int)((WIDTH/9)*1.5)/2)),(HEIGHT/2)+    
(HEIGHT/10),WIDTH/30,WIDTH/30);
//the constructor
public TheCars()
{
    //the following code creates the JFrame
    super("Radical Racing");
    setSize(WIDTH,HEIGHT);
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    setVisible(true);

    //start the inner class (which works on it s own because it is a thread)
    Move1 m1 = new Move1();
    Move2 m2 = new Move2();
    m1.start();
    m2.start();

  }
  //this will draw the cars and the racetrack
  public void paint(Graphics g)
 {
     super.paint(g);

  //set the color to blue for p1
    g.setColor(Color.BLUE);
    //now draw the actual player
    g.fill3DRect(p1.x,p1.width,p1.width,p1.height,true);

    //set the color to red for p2
    g.setColor(Color.red);
    //now draw the actual player
      g.fill3DRect(p2.x,p2.width,p2.width,p2.height,true);

}
private class Move1 extends Thread
{
    public void run()
            //This should all be in an infinite loop so that the process repeats.
    {
        while(true)
        {
        //now put in the try block. This will let 
        //the program exit if there is an error
        try
        {
            //first refresh the screen
            repaint();
            //increase speed a bit
            if(p1Speed<=5)
                p1Speed+=.2;
            p1.y-=p1Speed;

            //this delays the refresh rate
            Thread.sleep(75);
        }
        catch(Exception e)
        {
            //if there is an exception (an error), exit the loop
            break;

        }

        }
    }
}

private class Move2 extends Thread
{
    public void run()
    {
    //this should all be in an infinite loop so the process repeats
    while(true)
    {
    //now put the code in a "try" block.
        //this will let the program exit if there is an error
        try
        {
            //first refresh the screen
            repaint();
            //increase the speed a bit
                    if(p2Speed<=5)
                        p2Speed+=.2;
                    p2.y-=p2Speed;

                    //this delays the refresh rate
                    Thread.sleep(75);
        }
        catch(Exception e)
        {
            //if there is an exception (an error), exitthe loop
            break;
        }
    }
    }

 }
public static void main(String[]args)
{
    new TheCars();
}

}
问题回答

假设你重新绘画这些<代码>Rectangle直接放在屏幕上的物体,我们必须假设“HELI/2和“HELI/2 + HE/10 ”的表述是平等的,而不是零,而是小的。 如果健康是一种<条码>int,那么健康价值就超过2,低于10。 假设这些箱子在屏幕中显示,价值至少是100 couple。 <代码> 标题 (使用<条码>System.out.println()进行校正,并确保该校对窗户的实际高度。)

http://www.ohchr.org。

现在我们看到该法典的其余部分:对每一条呼吁提出的第二个论点是错误的。 应为<代码>y ——的物体,该物体数量众多,但经您重新通过width 成员,该成员人数不多。 改变这种呼吁,并回到轨道上:

g.fill3DRect(p1.x, p1.y, p1.width, p1.height, true);




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签