| View previous topic :: View next topic |
| Author |
Message |
rog9001 Expert Cheater
Reputation: 2
Joined: 22 Dec 2015 Posts: 214 Location: Jupiter
|
Posted: Thu Nov 17, 2016 8:27 am Post subject: Player Speed need help... |
|
|
So I found speed in the game I am playing but the way it works is if you go forward the value is positive but if you go backwards the value is negative. If I were to write
| Code: |
push esi
mov esi,(float)9
movss xmm1,esi
pop esi
|
and then try to go backwards it will only move me forward sins when moving backwards the value is meant to be negative. Is there a way to check which key is pressed like:
| Code: |
SART:
is "s" pressed
if so jmp backward
push esi
mov esi,(float)9
movss xmm1,esi
pop esi
jmp return
backward:
push esi
mov esi,(float)-9
movss xmm1,esi
pop esi
jmp return
return:
jmp START
|
|
|
| Back to top |
|
 |
++METHOS I post too much
Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Thu Nov 17, 2016 8:39 am Post subject: |
|
|
Have you tried doubling the xmm1 register as a test?
|
|
| Back to top |
|
 |
rog9001 Expert Cheater
Reputation: 2
Joined: 22 Dec 2015 Posts: 214 Location: Jupiter
|
Posted: Thu Nov 17, 2016 8:42 am Post subject: |
|
|
| ++METHOS wrote: | Have you tried doubling the xmm1 register as a test?
|
ya I did but the speed stays the same as the original.
|
|
| Back to top |
|
 |
++METHOS I post too much
Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Thu Nov 17, 2016 8:45 am Post subject: |
|
|
| You may be doing this all wrong, as player speed is typically a constant value, but assuming that you are actually dealing with the correct segment of code, then you should be able to analyze the surrounding code to determine where that velocity is coming from. If you post the entire code segment, someone might be able to assist you further.
|
|
| Back to top |
|
 |
rog9001 Expert Cheater
Reputation: 2
Joined: 22 Dec 2015 Posts: 214 Location: Jupiter
|
Posted: Thu Nov 17, 2016 8:47 am Post subject: |
|
|
| ++METHOS wrote: | | You may be doing this all wrong, as player speed is typically a constant value, but assuming that you are actually dealing with the correct segment of code, then you should be able to analyze the surrounding code to determine where that velocity is coming from. If you post the entire code segment, someone might be able to assist you further. |
oh ok. Well I will look around for now and if I don't find anything then I will post a code segment.
|
|
| Back to top |
|
 |
|