Sprite won't move...
void main( void )
{
int &dir;
int &xie;
int &yie;
sp_speed(¤t_sprite, 2);
}
void push( void )
{
freeze(1);
&dir = sp_dir(1, -1);
&xie = sp_x(¤t_sprite, -1);
&yie = sp_y(¤t_sprite, -1);
if (&dir == 2)
{
&yie += 50;
}
if (&dir == 4)
{
&xie -= 50;
}
if (&dir == 6)
{
&xie += 50;
}
if (&dir == 8)
{
&yie -= 50;
}
sp_hard(¤t_sprite, 1);
draw_hard_sprite(¤t_sprite);
if (&dir == 2)
{
move_stop(¤t_sprite , 2 , &yie , 1);
}
if (&dir == 4)
{
move_stop(¤t_sprite , 4 , &xie , 1);
}
if (&dir == 6)
{
move_stop(¤t_sprite , 6 , &xie , 1);
}
if (&dir == 8)
{
move_stop(¤t_sprite , 8 , &yie , 1);
}
//more stuff here, but it's stuck with the movement command.
Can anyone explain why it won't move.
I've set the hardness off, gave it a speed, and every movement is "nohard". I can't see what should go wrong.
It's the ReDink v0.04 ReDMod.exe, by the way, not the original Dink.exe.
{
int &dir;
int &xie;
int &yie;
sp_speed(¤t_sprite, 2);
}
void push( void )
{
freeze(1);
&dir = sp_dir(1, -1);
&xie = sp_x(¤t_sprite, -1);
&yie = sp_y(¤t_sprite, -1);
if (&dir == 2)
{
&yie += 50;
}
if (&dir == 4)
{
&xie -= 50;
}
if (&dir == 6)
{
&xie += 50;
}
if (&dir == 8)
{
&yie -= 50;
}
sp_hard(¤t_sprite, 1);
draw_hard_sprite(¤t_sprite);
if (&dir == 2)
{
move_stop(¤t_sprite , 2 , &yie , 1);
}
if (&dir == 4)
{
move_stop(¤t_sprite , 4 , &xie , 1);
}
if (&dir == 6)
{
move_stop(¤t_sprite , 6 , &xie , 1);
}
if (&dir == 8)
{
move_stop(¤t_sprite , 8 , &yie , 1);
}
//more stuff here, but it's stuck with the movement command.
Can anyone explain why it won't move.
I've set the hardness off, gave it a speed, and every movement is "nohard". I can't see what should go wrong.
It's the ReDink v0.04 ReDMod.exe, by the way, not the original Dink.exe.
There is a fair bit there to sort through. I have doubts about the local var '&dir' working right. There is an occasional bug when a local var starts with the same letter as a global var. Try changing the name of that local var, or if you use it often, make it a global var.
But first try alt/D just before that script runs (debug mode). Look in the log(it write the log in the dmod folder)at the last 'comparing' and see what var its using and what the log says after that.
But first try alt/D just before that script runs (debug mode). Look in the log(it write the log in the dmod folder)at the last 'comparing' and see what var its using and what the log says after that.
Now i'm not familiar with the ReDink engine, but are you SUUURE you gave that sprite a base_walk?
Try draw_hard_map instead of draw_hard_sprite... I think I've had problems with the latter before.