ZFGC

Resources => Coding => Topic started by: Zhello on June 16, 2009, 09:07:09 pm

Title: Zelda Rolling Code
Post by: Zhello on June 16, 2009, 09:07:09 pm
When I tried me game 2 things occur when I start to roll:
1. After rolling it resets number of rupees and
 2.Instead of actually rolling, I just roll in place rolls in place and
3.  When I roll all instances including monsters freeze in place without moving freely and smoothly afterwards they move.
 

 I tried many things to patch up the code but the other method makes me teleport within the rooms which is not what I want.

For objLink in order to perform this roll we press C:
Quote
instance_create(objLink.x,objLink.y,obj_Link_rolling)
instance_destroy()

Now the step event within the obj_Link_rolling is

Quote
global.Linkx=x
global.Linky=y

if global.facing="left"{
sprite_index=spr_linkrollleft
x -=4}

if global.facing="up"{
sprite_index=spr_linkrollup
y-=4}

if global.facing="right"{
sprite_index=spr_linkrollright
x+=4}

if global.facing="down"{
sprite_index=spr_linkrolldown
y+=4}

After the event is finish the end animation for the code is:

Quote
instance_create(x,y,objLink)
instance_destroy()

The errors I get was from editing the end animation code which was unexpected once game finish loading.

Title: Re: Zelda Rolling Code
Post by: Zaeranos on June 16, 2009, 09:34:16 pm
Hmmm, if I'm reading this correct your replacing a Link_object, with a Link_roll_object. That isn't really a smart thing to do. What I would do is set the state of Link to rolling and then swap the sprite. It then is pretty much the same like walking. Only there won't be any reaction to pressing any button.

How much programming background do you actually have? Have you read any tutorial on gamemaker, read the help files or even read the topics and/or viewed examples posted on this forum?
Title: Re: Zelda Rolling Code
Post by: Zhello on June 16, 2009, 09:40:27 pm
im learn the program little by little lol and this code was form from some research,  Ill try to edited the code more instead of setting it to destroy objLink.  Ill follow up on what you provided.

Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved