|
Post by Xenith on Nov 26, 2007 21:22:44 GMT -5
|
|
|
Post by Alexander_Q on Nov 27, 2007 12:30:25 GMT -5
I've been looking forward to this, cheers Xenith. It's true that most projects never get finished, but I guess they're still fun to work on at the time, and sometimes we even learn something. I've only done a few tutorials so far with Game Maker, but I'm hoping analysing this file will help me figure out a few things. Update: I've been trying to recreate 8-directional movement from scratch using the things I learned from looking at your code and this is what I've got: {
//1. 8 Directional Walking + Walking Sprite Change|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| if not (keyboard_check(vk_shift)) { if (keyboard_check(vk_left)) {dir="left"; sprite_index=spr_randi_none_walk_left; if (place_free(x-3,y)) {x-=3}} if (keyboard_check(vk_right)) {dir="right"; sprite_index=spr_randi_none_walk_right; if (place_free(x+3,y)) {x+=3}} if (keyboard_check(vk_up)) {dir="up"; sprite_index=spr_randi_none_walk_up; if (place_free(x,y-3)) {y-=3}} if (keyboard_check(vk_down)) {dir="down"; sprite_index=spr_randi_none_walk_down; if (place_free(x,y+3)) {y+=3}} } //2. 8 Directional Running + Running Sprite Change|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| if (keyboard_check(vk_shift)) { if (keyboard_check(vk_left)) {dir="left"; sprite_index=spr_randi_none_run_left; if (place_free(x-5,y)) {x-=5}} if (keyboard_check(vk_right)) {dir="right"; sprite_index=spr_randi_none_run_right; if (place_free(x+5,y)) {x+=5}} if (keyboard_check(vk_up)) {dir="up"; sprite_index=spr_randi_none_run_up; if (place_free(x,y-5)) {y-=5}} if (keyboard_check(vk_down)) {dir="down"; sprite_index=spr_randi_none_run_down; if (place_free(x,y+5)) {y+=5}} }
//3. Return to still position.||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| if not (keyboard_check(vk_left)) and not (keyboard_check(vk_right)) and not (keyboard_check(vk_up)) and not (keyboard_check(vk_down)) { if (dir="left") {sprite_index=spr_randi_none_still_left}; if (dir="right") {sprite_index=spr_randi_none_still_right}; if (dir="up") {sprite_index=spr_randi_none_still_up}; if (dir="down") {sprite_index=spr_randi_none_still_down}; dir="none" }
|
I've figured out how to take the .gif file sprites from your project, and with your permission, I'd like to use them in mine. Did you rip them yourself, or did you find them elsewhere? I wasn't able to find running .gifs anywhere. I have some questions about your project: 1. I have the problem where the sprite tends to get stuck in walls while moving past them, and I noticed you mentioned that in your change log. I've played around with the bounding box (been using that instead of a mask) but can't find a way to overcome the problem. How did you do it? 2. I noticed the entry "depth--y" in your code and figured that was somehow used to make the sprite display above/behind things where appropriate. I can't seem to get the same effect in my project. How did you make the sprite display below other objects when behind them and aboe them when in front?
|
|
|
Post by Xenith on Nov 27, 2007 22:22:45 GMT -5
I'm not entirely sure these days. 1.) You do need the mask, and if place_free (x-4,y){ x-=4} //left if place_free(x+4,y){x+=4} //right if place_free(x,y+4){y+=4} //down if place_free(x,y-4){y-=4} //up
I think.....
2.) I'm not sure about this one either, double click the character in the objects tab and set his depth to 1 then in his step event "depth = -y" (without quotations)
And yeah, I ripped all the graphics from the rom. So if you do use them I think you could give a link to this site in the credits or something. That goes especially for the tiles which I spent hours trying to rip (Those stones that hold the water were a nightmare, not to mention the water itself).
|
|
|
Post by Alexander_Q on Nov 28, 2007 22:08:42 GMT -5
Wow, having the mask made everything perfect, now there's no sticking anywhere.
The depth thing wasn't working because I hadn't set the origin of the npc sprites to their bases, so their y coordinate was returning higher than the hero sprites while he was standing behind them. All good now.
I've gotten npcs to respond to heroes attack, so I'm gonna make some enemies next and try and get them to bounce back when attacked like in the original.
Question: Did you ever manage to rip the animation when the hero gets hit, and if not, could you give me some advice as to the best way to rip sprites? Any sprites not included in your game file would be very helpful to me
|
|
|
Post by Alexander_Q on Nov 29, 2007 20:53:35 GMT -5
I'm going to upload my project file to try and renew interest in this. I'll update the link each time I do something drastic. Would love for you to be enthusiastic about this again Xenith, but if not I understand. Should I start a new thread for the project? rapidshare.com/files/73230098/SOM_Merged.gmk.htmlControls ----------- ARROW KEYS - Move ENTER - Attack SHIFT - Sprint A - Decrease health S - Increase health Features ----------- -Functional display of health for values up to 999. -8-directional walk/sprint -Non-stick walls -Enemies react to attacks by bouncing back -Almost complete field tileset with good blocking Status -------- At the moment I'm perfecting the enemy bouncing action - the rabites don't always bounce back the same distance even if there is nothing blocking them and I haven't been able to figure out why. Any input would be much appreciated. Hats of to you Xenith, and as I understand, IsmAvatar, for making this project possible.
|
|
|
Post by IsmAvatar on Nov 30, 2007 0:26:29 GMT -5
Don't give me too much credit, it's not like I co-programmed the game. I just deserve a small spot in the "Special Thanks" area of the Credits
|
|
|
Post by Alexander_Q on Nov 30, 2007 1:07:39 GMT -5
As you wish. Thanks again for the code you game me over at GMC.
|
|