AGI1122 |
This is the code for making your ego swim just change a few things to make it work with your game. // Put the code below into the all rooms that have water. // Beginnning of code if (ego_on_water) { |
smartguy240 |
AGISCI wrote: |
AGI1122 |
f100 was basically a flag I used to make sure the write animation of the ego is drawn... this code is quite old, I have rewritten it. You can set f100 to whatever flag you want it doesn't make any difference in the code. The only things that need to be changed are these: new_ego_x = new_ego_x - 7;7 is what I got when I subtracted the width of the ego view and the swimming view. Just subtract the ego view from the swimming view and place that number in place of the 7. And also change this: new_ego_x = new_ego_x + 11;I got the 11 by adding 4 to the 7 I got from earlier. Just add 4 to whatever number you got for the above and replace 11 with it. Good luck with this. And if you can't get it to work I will post the new swimming code I have. |
smartguy240 |
Well, I cant seem to get this code to work. Am I supposed to draw something on my picture resoucre? is it outdated(is that possible? :) ) SMG240 |
AGI1122 | As I said this is old code AND it is specifically for somebodies game. He asked for a swimming code and I made it for him. With some tweaking it should work for you though. |
smartguy240 | Oh :- |
smartguy240 | What would I do to "tweak" it? I changed those things that you said to change. |
AGI1122 |
Here is what it looks like now which works much better than the code above:if (ego_on_water) { You still will need to change some values depending on the size of the ego's view and the ego's swimming view. |