The Daily Click ::. Forums ::. Klik Coding Help ::. Granade blowing left
 

Post Reply  Post Oekaki 
 

Posted By Message

eyeangle



Registered
  12/06/2003
Points
  1683
10th January, 2008 at 23:51:53 -

Platform game:
Scrolling level: 1600x1200
Screen game size: 800x600

For some reason, when throwing a granade straight up (using pinball movement) into the air it blows a bit to the left when the screen is scrolling to me. When the scrolling finally comes to a stop, only then the granade then shoots straight up. But as soon as I move again it starts to blow left again, what ever direction my sprite is facing.
But when I'm on the far right of the level or in a non-scrolling level, I don't have this problem. The granade shoots straight up and comes straight back down.

The event is really quite simple: Press Fire button 2, animation stopped is playing, sprite is facing up = Create granade, and set direction to up.

When I disable the Scrolling events I don't have this problem. So it has something thing to do with that but I can't put my finger on it.

Thank.

 
theonecardgame.com

Joe.H

Evil Faker

Registered
  19/08/2002
Points
  3305
11th January, 2008 at 04:44:12 -

As you scroll, the grenade stays in position, so it will appear to move. In fact it's the character that is moving.

if you want to always keep it in position, set it's x co-ordinate to X("Character")

 
My signature is never too big!!!

eyeangle



Registered
  12/06/2003
Points
  1683
12th January, 2008 at 22:03:29 -

Is there an equation I can add to make the grandade follow where I throw it and not move with the screen?

I can't set its X co-ordinate to X("Player") becasue sometimes I'm throwing it left, right, diagnol up/left, diagnol up/right, diagnol down/left, diagnol down/right. So I was just wondering if I could minus the screen's movement so that it only stays where I throw it. Hmm, it's gonna be tricky but does anyone have a clue???

Image Edited by the Author.

 
theonecardgame.com

Cazra

Crazy?

Registered
  24/07/2002
Points
  4472

Game of the Week WinnerVIP Member
12th January, 2008 at 22:36:14 -

do you mean like creating an inertia effect? Like adding the player's velocity to the grenade's initial velocity?

 
n/a

DaVince

This fool just HAD to have a custom rating

Registered
  04/09/2004
Points
  7998

Game of the Week WinnerClickzine StaffHas Donated, Thank You!Cardboard BoxDos Rules!
13th January, 2008 at 11:37:18 -

A solution could be to make it move to the left/right faster if you're throwing them when you're moving. Just have the object have a speed variable that adjusts to when you throw it while walking or standing still.

 
Old member (~2004-2007).
   

Post Reply



 



Advertisement

Worth A Click