Posted By: Angwie_Tea
Push Box games - 11/08/07 02:20
Hi..
Can george or someone help make sample code for push box games (sokoban)?
I didnt see in AUM or forum..
thanks
Posted By: Nems
Re: Push Box games - 11/08/07 17:10
I've never played Sokoban so not sure here but George has made an example 'push box' script in one of the later AUMs I recall and Shorevietman has examples in his RPG game.
This might help for the meantime or at least, get a look in at the code base untill you get better answers..
Posted By: Angwie_Tea
Re: Push Box games - 11/09/07 02:04
Hi...
Thanks for answer..
I have AUM no1-no67..Which AUM?
maybe I should double check that AUM again...
i see pushbox demo in Acknex Resource too..but no source
Posted By: Nems
Re: Push Box games - 11/09/07 18:36
From AUM 43
Q: If I would kick a box, how would I program it so that it moves in the opposite direction without losing its original pan and tilt angles?
A: Use the code below. Run into the box to move it.
function move_boxes()
{
vec_rotate (vector(2 * (my.x - player.x) * time, 0, 0), player.pan);
vec_add (my.x, vector(2 * (my.x - player.x) * time, 2 * (my.y - player.y) * time, 0));
}
action my_box
{
while (player == null) {wait (1);}
my.enable_impact = on;
my.enable_entity = on;
my.event = move_boxes;
}
[EDIT]...and AUM58
Q: I need to have a box that can be pushed by the player. Can you help?
A: Use this example.
action pushable_box
{
while (player == null) {wait (1);}
var my_angle;
while (1)
{
// play with 50 - it depends on the size of the box
if (vec_dist (player.x, my.x) < 50)
{
vec_set(temp.x, player.x);
vec_sub(temp.x, my.x);
vec_to_angle(my_angle.pan, temp.x);
temp.x = -10 * cos(my_angle.pan - my.pan) * time;
temp.y = -10 * sin(my_angle.pan - my.pan) * time;
temp.z = -1 * time;
c_move (my, temp.x, nullvector, ignore_you | ignore_passable | glide);
}
wait (1);
}
}
[ENDEDIT]
Posted By: Angwie_Tea
Re: Push Box games - 11/10/07 03:38
Ok..I find it and will try it
( I only search AUM in beginner corner and workshop)
Thanks alot
Posted By: Angwie_Tea
Re: Push Box games - 11/10/07 03:42
PS: I got pushbox source too from User Contributions
but I got error when run it.. I will check it
Posted By: Gandalf
Re: Push Box games - 11/10/07 09:36
I believe remember that the source code of Pushbox has some bugs. It differs a bit from version wrapped.
I still work on this project, I changed the gameplay and I add him an level editor.