#1
by cys » 8年前
コード:
void obj(void)
{
draw(objx, objy, 20.0f,);
}
void player(void)
{
draw(playerx, playery, 20.0f,);
}
void hittest(void) {
if ((objx < playerx + 20) &&
(playerx < objx + 20) &&
(objy < playery + 20) &&
(playery < objy + 20)) {
playerx=playerx;
}
プレイヤーがオブジェクト(ブロック)の上に乗る
プレイヤーを移動してオブジェクトに当たるとプレイヤーは移動できなくなる
上の2つの事をしたいのですがわからないので上記のプログラムを教えてください
[code]
void obj(void)
{
draw(objx, objy, 20.0f,);
}
void player(void)
{
draw(playerx, playery, 20.0f,);
}
void hittest(void) {
if ((objx < playerx + 20) &&
(playerx < objx + 20) &&
(objy < playery + 20) &&
(playery < objy + 20)) {
playerx=playerx;
}
[/code]
プレイヤーがオブジェクト(ブロック)の上に乗る
プレイヤーを移動してオブジェクトに当たるとプレイヤーは移動できなくなる
上の2つの事をしたいのですがわからないので上記のプログラムを教えてください