The Daily Click ::. Forums ::. Klik Coding Help ::. Scrolling rail shooter problem.
 

Post Reply  Post Oekaki 
 

Posted By Message

vrba79



Registered
  17/03/2007
Points
  125
2nd April, 2007 at 22:36:29 -

Doing a scrolling shooter(Think Operation Wolf).
But the problem is that I can't keep the cursor/crosshair inside the window as it scrolls,(the field follows an invisible object that travels it's own x coordinate+1).
Trying to figure a way to fix this, other then that the damned thing works just fine.

 
[Will watch Aquaman cartoons for beer money.]

Bo Fu



Registered
  02/04/2004
Points
  413

VIP Member
2nd April, 2007 at 23:14:26 -

What're you using for the cursor? Are you using the mouse-controlled option, or are you using events?

Always
-Set X Position of Cursor to X Position of Mouse
-Set Y Position of Cursor to Y Position of Mouse

And you should be good.

 
If wishes were fishes then we'd all smell like ladies' underwear.

Paul_James



Registered
  02/07/2002
Points
  1320
3rd April, 2007 at 00:53:07 -

if ur not using a mouse u can create another object that is a set position away from the invisible object - (so that it scrolls at the edge of the screen)

Crosshairs Overlap Active
Run Loop 1 time (im not sure about the number of times, it really depends on the pixel size of the crosshair)

On Loop
Set crosshair x position + 1

should work

 
Its not enough,I need more
Not enough to satisify
I said I dont want it, I just need it.
To believe, to feel, to know I'm alive.

Knuckle deep beneath the borderlines.
This may hurt a little but its something you'll get used to.
Relax. Slip Away...

Peblo

Custom ratings must be 50 characters or less

Registered
  05/07/2002
Points
  185

Game of the Week WinnerVIP MemberI'm on a Boat360 OwnerAttention GetterThe Cake is a LieCardboard BoxHero of TimePS3 OwnerIt's-a me, Mario!
I'm a Storm TrooperSonic SpeedStrawberryI like Aliens!Wii OwnerMushroomGhostbuster!
3rd April, 2007 at 01:21:08 -

No, that's completely inefficient and wrong. Learn fastloops.

 
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath

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!
3rd April, 2007 at 04:47:07 -

Loop once? That has the same effect as not looping at all, only slower.

 
Old member (~2004-2007).

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
3rd April, 2007 at 04:48:02 -

There's no point in running a fastloop for 1 loop; it's the same as just executing the event directly.

Either do what Bo Fu said, or if you're using the mouse movement, I think you have to uncheck "follow playfield" in object properties.

 
n/a

vrba79



Registered
  17/03/2007
Points
  125
3rd April, 2007 at 12:48:47 -

"Always
-Set X Position of Cursor to X Position of Mouse
-Set Y Position of Cursor to Y Position of Mouse
"

Once again custom movements saves the day! Thanks!

 
[Will watch Aquaman cartoons for beer money.]

~Matt Esch~

Stone Goose

Registered
  30/12/2006
Points
  870

VIP Member
3rd April, 2007 at 13:32:42 -

just out of interest, does running a code loop for 1 loop execute it instantly regardless of its position? Imagine you have an event occuring at multiple times throughout your code, would replacing those events with a fastloop that performs the events once be more efficient than copying the code into multiple places?

 
http://create-games.com/project.asp?id=1875 Image


Fifth

Quadruped

Registered
  07/05/2003
Points
  5818

VIP MemberGOTW JULY 2010 WINNER!Kliktober Special Award TagGOTW HALLOWEEN 2011 WINNERPicture Me This Round 51 Winner!
3rd April, 2007 at 14:11:29 -

It would, indeed, execute instantly. I suppose if done correctly, you COULD avoid some redundant code like that.
There's also the Fast Function object that might be better suited for the job, but I've never actually tried it.

Image Edited by the Author.

 
Go Moon!

Paul_James



Registered
  02/07/2002
Points
  1320
3rd April, 2007 at 16:38:15 -

okay so everyone bad mouth me but i tested it and it worked (although u were right about the looping one time)

 
Its not enough,I need more
Not enough to satisify
I said I dont want it, I just need it.
To believe, to feel, to know I'm alive.

Knuckle deep beneath the borderlines.
This may hurt a little but its something you'll get used to.
Relax. Slip Away...

~Matt Esch~

Stone Goose

Registered
  30/12/2006
Points
  870

VIP Member
3rd April, 2007 at 16:40:42 -

Everyone bad-mouthed you? I thought everyone assumed being bad-mouthed was a compulsory part of participating in the click community

 
http://create-games.com/project.asp?id=1875 Image

   

Post Reply



 



Advertisement

Worth A Click