The Daily Click ::. Forums ::. Klik Coding Help ::. Shootemup problem...
 

Post Reply  Post Oekaki 
 

Posted By Message

tobbe



Registered
  26/05/2003
Points
  41
25th September, 2004 at 13:58:51 -

Hi, I've started a simple sidescrolling shootemup. THe problem I have is just scrolling. I want the screen to move towards the right the whole time, and the ship, when the screen almost goes past him, he gets "pushed" so that the ships is always in the screen. This is in all shootemups, but I cant seem to fix this.
Thanks in advance/ Tobbe

 
pixel artist

Joe.H

Evil Faker

Registered
  19/08/2002
Points
  3305
25th September, 2004 at 14:45:06 -

use an invisible detector at the edge of the screen you want it pushed from, and always set it's x position to x of the object plus something. and always set the scrolling position to a certain position from the detector.

Then, if the ship is overlapping the detector, set it's position to the same rate as the detector x moving speed

 
My signature is never too big!!!

The Chris Street

Administrator
Unspeakably Lazy Admin

Registered
  14/05/2002
Points
  50117

Game of the Week WinnerClickzine StaffAcoders MemberKlikCast StarVIP MemberPicture Me This Round 35 Winner!Second GOTW AwardYou've Been Circy'd!Picture Me This Round 38 Winner!GOTM December Third Place!!
I am an April FoolKliktober Special Award Tag
25th September, 2004 at 14:48:08 -

Or you could try:

x position of x(ship) is equal or lower than X left frame: Set x position of x(ship) to x + whatever

 
n/a

tobbe



Registered
  26/05/2003
Points
  41
25th September, 2004 at 16:35:49 -

ok thanks, I will try that. Just before I do, is this for the actual game edge (ie size of the entire map) or just the edge of what you see? cus I was aiming for the later...

 
pixel artist

The Chris Street

Administrator
Unspeakably Lazy Admin

Registered
  14/05/2002
Points
  50117

Game of the Week WinnerClickzine StaffAcoders MemberKlikCast StarVIP MemberPicture Me This Round 35 Winner!Second GOTW AwardYou've Been Circy'd!Picture Me This Round 38 Winner!GOTM December Third Place!!
I am an April FoolKliktober Special Award Tag
25th September, 2004 at 17:03:05 -

its the edge of what you see. If you type in something like "x left frame" that means the left edge of what you can see. Its not the whole frame size, just the scrolling area

Actually, thinking about it, my event could be modified to:

Position of X(ship) is lower or equal to x left frame:

then::

Set x position of x(ship) to x left frame + 4

-----

So if the ship starts to disappear off the left visible edge, then it will automatically be placed just after it. Good luck


 
n/a

Noyb



Registered
  31/05/2004
Points
  1117

VIP Member
25th September, 2004 at 19:47:44 -

Image
Topic number 1337. Don't you feel special?

 
"Omg. Where did they get the idea to not use army guys? Are they taking drugs?" --Tim Schafer on originality in videogames

tobbe



Registered
  26/05/2003
Points
  41
26th September, 2004 at 04:50:21 -

Circy: I tried it your way, precisley as you wrote it. but the screen goes past him and he does nothing... do you know what I have done wrong?
here is the coding:
http://www.gazler.com/users/ifrit//tgf.gif

Edit: 1337? cool...

Image Edited by the Author.

 
pixel artist

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
26th September, 2004 at 07:06:51 -

No, not the left of the Active Object, the left of the frame. Find it in the Storyboard object.

 
n/a

tobbe



Registered
  26/05/2003
Points
  41
26th September, 2004 at 07:11:56 -

oh, now I understand what I did wrong. Thanks for the help, it works now, but its a bit buggy (the ship jumps constantly). If anyone got any ideas on how too fix that I'll be glad, but otherwise, thans for the help so far!

 
pixel artist

Tigerworks

Klik Legend

Registered
  15/01/2002
Points
  3882
26th September, 2004 at 08:33:54 -

I'll assume your ship is 100 pixels wide, and the hot spot is in the middle, 50 pixels in.
You need to do:

X position of Ship lower than X Left Frame + 50
: Set X position of Ship to X Left Frame + 50

That should be nice and smooth.

 
- Tigerworks

tobbe



Registered
  26/05/2003
Points
  41
26th September, 2004 at 10:46:32 -

that worked very well, thanks!

Image Edited by the Author.

 
pixel artist

Willy C



Registered
  14/02/2004
Points
  1524

Game of the Week WinnerKlikCast StarPicture Me This -Round8- Winner!VIP MemberWii OwnerIt's-a me, Mario!Hero of TimeThe Cake is a LiePS3 OwnerI am an April Fool
Batman!Teddy Bear
26th September, 2004 at 13:22:49 -

whats so special with the number 1337?

 
http://www.robocaptain.com

AsparagusTrevor

Mine's a pint of the black stuff

Registered
  20/08/2002
Points
  2364

Game of the Week WinnerHas Donated, Thank You!VIP MemberEvil kliker
26th September, 2004 at 15:15:29 -

It's the retarded internet nerd way of spelling elite. Dumb, I know.

 
Image

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
26th September, 2004 at 15:25:54 -

You won't be calling it retarded when they h4x0r into j00r account. You'll ph33r them. YOU'LL PH33R THEM ALL!

 
n/a

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
26th September, 2004 at 15:27:02 -

Oh yeah, I pheer them sooo much..

 
Craps, I'm an old man!
   

Post Reply



 



Advertisement

Worth A Click