Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Character movement


cheatking
 Share

Recommended Posts

Ok for character movement This code:
```
      If X >= (576) Then
            rec.Left = rec.Left + (NewX - X) - 32
            rec.Right = rec.Left + (NewX - X) + 32
            X = 576
        End If
```Should draw the first 64 pixels (x axis) of the sprite when it reaches the right edge of the screen. But for some reason it dissapeers for a second.

I have similar code on the left side of the screen and that works fine.
Link to comment
Share on other sites

You said it works to the left so did you try changing it to this:

```
      If X >= (576) Then
            rec.Left = rec.Right + (NewX - X) - 32
            rec.Right = rec.Right + (NewX - X) + 32
            X = 576
        End If
```
Link to comment
Share on other sites

      If X >= (576) Then
            rec.Left = rec.Right + (NewY - Y) - 32
            rec.Right = rec.Right + (NewY - Y) + 32
            Y = 576
        End If
?
try that
Link to comment
Share on other sites

@Dope :

> link=topic=45005.msg455934#msg455934 date=1243201422]
> Ok for character movement This code:
> ```
>       If X >= (576) Then
>             rec.Left = rec.Left + (NewX - X) - 32
>             rec.Right = rec.Left + (NewX - X) + 32
>             X = 576
>         End If
> ```Should draw the first 64 pixels (x axis) of the sprite when it reaches the right edge of the screen. But for some reason it dissapeers for a second.
>
> I have similar code on the left side of the screen and that works fine.

rec.Right = rec.Left
yeah…
that will do it...
not sure, but it might be that you need rec.Right = rec.Right instead of rec.Left
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...