Skip to content
Snippets Groups Projects
Commit 606b3950 authored by KritzJ's avatar KritzJ
Browse files

Correction of collision method on movement

parent 5cc3ed5f
No related branches found
No related tags found
No related merge requests found
......@@ -172,12 +172,10 @@ mapping Unity::Component::Component2Class() : Prog::Class {
' + rigidbody.identifier + '.AddForce(new Vector2(0,1) * ' + jumpIntensity.identifier + ');
' + isGrounded.identifier + ' = false;';
updateMethod.body += rigidbody.identifier + 'AddForce(new Vector2(' + horizontal.identifier + '* ' + speed.identifier + ', 0));';
collisionMethod.body += 'DataManager manager = GameObject.Find("DataManager").GetComponent("DataManager") as DataManager;';
collisionMethod.body += 'if (collider.gameObject.tag == "Enemy")
{
manager.setScore(manager.getScore() + 100);
Destroy(gameObject);
}';
collisionMethod.body += 'if (collider.gameObject.tag == "Floor")
{
isGrounded = true;
}';
} else {
var vertical := object MemberDef {
identifier := 'vertical';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment