Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Nymphodora), 1,470 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Push Box games #166443
11/08/07 02:20
11/08/07 02:20
Joined: Feb 2007
Posts: 20
A
Angwie_Tea Offline OP
Newbie
Angwie_Tea  Offline OP
Newbie
A

Joined: Feb 2007
Posts: 20
Hi..

Can george or someone help make sample code for push box games (sokoban)?
I didnt see in AUM or forum..

thanks

Re: Push Box games [Re: Angwie_Tea] #166444
11/08/07 17:10
11/08/07 17:10
Joined: Mar 2003
Posts: 4,264
Wellington
Nems Offline

.
Nems  Offline

.

Joined: Mar 2003
Posts: 4,264
Wellington
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..

Re: Push Box games [Re: Nems] #166445
11/09/07 02:04
11/09/07 02:04
Joined: Feb 2007
Posts: 20
A
Angwie_Tea Offline OP
Newbie
Angwie_Tea  Offline OP
Newbie
A

Joined: Feb 2007
Posts: 20
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

Re: Push Box games [Re: Angwie_Tea] #166446
11/09/07 18:36
11/09/07 18:36
Joined: Mar 2003
Posts: 4,264
Wellington
Nems Offline

.
Nems  Offline

.

Joined: Mar 2003
Posts: 4,264
Wellington
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]

Last edited by Nems; 11/09/07 20:28.
Re: Push Box games [Re: Nems] #166447
11/10/07 03:38
11/10/07 03:38
Joined: Feb 2007
Posts: 20
A
Angwie_Tea Offline OP
Newbie
Angwie_Tea  Offline OP
Newbie
A

Joined: Feb 2007
Posts: 20
Ok..I find it and will try it
( I only search AUM in beginner corner and workshop)
Thanks alot

Re: Push Box games [Re: Angwie_Tea] #166448
11/10/07 03:42
11/10/07 03:42
Joined: Feb 2007
Posts: 20
A
Angwie_Tea Offline OP
Newbie
Angwie_Tea  Offline OP
Newbie
A

Joined: Feb 2007
Posts: 20
PS: I got pushbox source too from User Contributions
but I got error when run it.. I will check it

Re: Push Box games [Re: Angwie_Tea] #166449
11/10/07 09:36
11/10/07 09:36
Joined: Jul 2003
Posts: 85
France
Gandalf Offline
Junior Member
Gandalf  Offline
Junior Member

Joined: Jul 2003
Posts: 85
France
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.


Moderated by  George 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1