![]() |
hurt()
Is there any way, while using this function, I can make the player recoil in the direction I want?
I've tried changing player.hurtdx/dy but apparently they're read only. |
maybe have a complete movement system ? so it would be easier.
or maybe something like function onCreated() { this.newdir=player.dir } then hurt() this.newdir = (number); idk xD |
Nah, I don't want to do a complete movement system for a simple project. And it isn't effected by direction, but by delta.
|
Which way do you want to recoil? Unless I've never paid attention to it, the sprites recoil in the opposite direction they're facing. The "physics" seem right to me.
|
No, the recoil away from the direction they were hit... in the case of hurt(), since they weren't hit by someone else, there is no default recoil direction... which is what I want to define.
|
Quote:
Have you tried hitplayer(index, halfhearts, fromx, fromy)? hitplayer(0, 1, 45, 50); seems to recoil the player down to the left, diagonally. |
Quote:
|
Quote:
EDIT: Actually, using an index other than 0 produces as access violation (Vista). Bug, perhaps? |
Use hitplayer() with player.index. Worked for me last time I had the exact same problem as yours.
Edit: Now that I think about it, I looked for that in a pretty old piece of code, and somehow player.index doesn't make sense to me. Might just be 0... |
Ya, hitplayer with 0 did work, thanks for the help :)
|
| All times are GMT +2. The time now is 03:09 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.