sdslabs/Rubeus

Problematic GameObject creation API

twaritwaikar opened this issue · 3 comments

Master HEAD: dffd53a

OS version: Windows 10 Home Edition

Steps to Reproduce: Invoke any of the RGameObject's public constructors

Issue Presentation Code:

	RGameObject * object1 = new RGameObject(2, 2, 3, 3, "Assets/debug.png", true, new APhysicsObject(mat, true, EColliderType::BOX, new ABoxCollider(RML::Vector3D(), RML::Vector3D(3.0f, 3.0f, 1.0f))));

The code above requires the user to provide with a physics material and a sprite, which is fine but it also requires the user to provide a physics object, which is not something that the user should be handling.

The user should only be responsible for providing the collider type and coordinates of the object(also of the sprite).

How about using JSON to declare objects instead of the mess we are using now? Using Lua shall fix some parts of the ugliness but that isn't coming prior to launch. JSON declares objects might also help to organize large projects on Rubeus.

A solution can be related to fixing #82

Fixed in v2 with the introduction of the Game class