gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Moving a sprite Like shooting a laser

#104728 - shadowghost21 - Mon Oct 02, 2006 1:01 am

I am using PAlib 060917 and I can quite fiqure out how to have a laser fire from a space ship and move across the screen. I can post my code if you wish, but then you will also need the gfx file from the PAlib and somthing to use as a laser, as I made mine in Paint.
-shadowghost21

#104729 - ProblemBaby - Mon Oct 02, 2006 1:05 am

maybe I dont understand your question but try to make up the laser by several 32x8 sprites?

#104733 - shadowghost21 - Mon Oct 02, 2006 3:02 am

I guess I can refrase it. I want to fire a laser from a spaceship. I currently have the laser as one sprite and am trying to increase the y-position. I end up with it coming out and freaking out. I want to move the sprite up from the x-position of the ship and move stright out to the top of the screen but this is my problem. If there are any games that use this concept I would love to see some source ad I have been unable to locate source for games thus far, and if they where written using PAlib even better (as tha is what I am using)
-shadowghost21


EDIT I got it figured out I need to relay the coords that I stored to a PA_SetSpriteY so it would move the sprite then I added PA_WaitForVBL so it would snyc real nice like and my while loop worked like a charm!!

#104764 - xtoc - Mon Oct 02, 2006 1:22 pm

it's pretty easy to do this, i could create a example if you like, but mostly i check the palib help forum, if you could create a post over there included the example picture....