Skip to content

Commit

Permalink
game now uses all iron meshes when generating iron
Browse files Browse the repository at this point in the history
  • Loading branch information
Untrustedlife authored and hhyyrylainen committed Feb 15, 2019
1 parent 6f1163f commit 546c4ae
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion scripts/microbe_stage/setup.as
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,24 @@ ObjectID createIron(CellStageWorld@ world, Float3 pos)
Ogre::Degree(GetEngine().GetRandom().GetNumber(0, 360)),
Ogre::Vector3(0,1,1)));
renderNode.Node.setPosition(pos);
auto model = world.Create_Model(ironEntity, renderNode.Node, "iron_01.mesh");
string mesh="";
// There are four kinds
switch (GetEngine().GetRandom().GetNumber(0, 3))
{
case 0:
mesh="iron_01.mesh";
break;
case 1:
mesh="iron_02.mesh";
break;
case 2:
mesh="iron_03.mesh";
break;
case 3:
mesh="iron_04.mesh";
break;
}
auto model = world.Create_Model(ironEntity, renderNode.Node, mesh);
// Need to set the tint
model.GraphicalObject.setCustomParameter(1, Ogre::Vector4(1, 1, 1, 1));

Expand Down

0 comments on commit 546c4ae

Please sign in to comment.