iraq
Member
|
Inventory Problem
Hi,
I wanted to make inventory in my game so I decided to use example code: "02 - Inventory". I was mix that code with "17 - Camera Collisions". As a result I receive game, but I want to do "auto-picking up" without using mouse. Can u transform code to auto-pickup, please? I can't do this :(
Sorry for my English
|
|
12-13-2009 11:09 PM |
|
Seba
Member
|
RE: Inventory Problem
You have it in BM.
Quote:void Player::autoPickUp()
{
Memb<Game::Obj*> obj;
Vec test_pos=pos()-Vec(0,ctrl.height()/2,0);
Game::World.objQuery(obj,Ball(2,test_pos),OBJ_ITEM);
REPA(obj)
if(Item *item=CAST(Item,obj[i]))
if(item->type==ITEM_WEAPON && item->mesh && Dist(test_pos,item->mesh->box*item->matrixScaled())<=ctrl.radius()+0.1f)
{
AddMessage(S+"Picked up "+item->name);
itemPickUp(*item);
}
}
Check in Player.cpp
|
|
12-14-2009 08:17 PM |
|
iraq
Member
|
RE: Inventory Problem
thx man
(This post was last modified: 12-16-2009 08:26 PM by iraq.)
|
|
12-16-2009 08:26 PM |
|