journal
all all entries rss SoML excited dreams runes YRUU ultimate KTRU skate sleepy nihongo
Rob is 20,127 days old today.
prev day next day printable version

Entries this day: got-basic-pong-ai-working 日本語を勉強しました

got basic pong ai working

1:29 Friday 08 May 2015 JST

Now my AIMoveRacket script looks something like this:

using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class AIMoveRacket : MonoBehaviour {

	public float speed = 30;
	public float speedIncreaseMax = 50;
	
	private GameObject myTarget;
	private Transform ball;
	private SliderJoint2D mySlider;

	// Use this for initialization
	void Start () {
		// this slider will keep the paddles moving in precise lines
		mySlider = gameObject.AddComponent<SliderJoint2D>();
		mySlider.connectedAnchor = gameObject.transform.position;
		mySlider.enableCollision = true;
		mySlider.angle = 90;		// needs to be 0 if we have paddles on top or bottom
	}

	// Update is called once per frame
	void FixedUpdate () {
		if (!ball) {
				myTarget = BallSpawner.instance.theBall ();
				ball = myTarget.transform;
			} else {
				return;
			}
		}
		Vector2 myPostion = gameObject.GetComponent<Rigidbody2D> ().position;
		if (ball.position.x > -9999) {
			myPostion.y = Mathf.Lerp (myPostion.y, ball.position.y, 10 * Time.deltaTime);
		}
		myPostion.y = Mathf.Clamp (myPostion.y, -14, 14);
		gameObject.GetComponent<Rigidbody2D> ().position  = myPostion;
	}
}
permalink

日本語を勉強しました

11:17 Friday 08 May 2015 JST

There are probably errors in the Japanese notes below!

  1. 不換紙幣 ふかんしへい fiat currency
  2. 著作 ちょさく writing (book)
  3. 潰す つぶす squish
  4. 抽象的 ちゅうしょうてき abstract
  5. かみなり lightning
  6. 大津市 おおつし 大津市はびわ湖の西ところ。
  7. 福井県 ふくいけん 福井県は滋賀県の北にいます。
  8. 岡山県 おかやまけん 岡山県は鳥取県の南の県。
  9. 島根県 しまねけん 島根県は鳥取県の西の県。
  10. 静岡県 しずおかけん 静岡県は神奈川県の南の県。
  11. 大分県 おおいたけん 
  12. 新潟県 にいがたけん 新潟県の漢字が変な発音と思う。
  13. ちち dad
  14. はは mom
  15. 等しい ひとしい equal
  16. 欲しい ほしい WANT
permalink
prev day next day