Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Problem with combining sprites

Author
Message
Andrzejef
14
Years of Service
User Offline
Joined: 26th Dec 2011
Location:
Posted: 7th May 2012 20:55
Hi
I try to make my 2D shooter based on Cyberstorm and AlienBreed series. And I'm stuck. I tried to figure out how to combine two sprites and failed. The first one is the sprite of hull of the tank and the second is it's cannon. And I want them to move independently (tank is moving in it's own direction, and the cannon has to fire all around pointed into cursor). The problem is that sprites go in it's own direction and they are suppose to go together, not separate ways. Any help there?
Thnaks in advance.
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 7th May 2012 21:31
Well you have the command sprite x, and sprite y to get the sprite positions of the tank to use on the turret.

enderleit
19
Years of Service
User Offline
Joined: 30th May 2007
Location: Denmark
Posted: 7th May 2012 21:37 Edited at: 7th May 2012 21:39
Use offset sprite on the cannon to set the base of the barrel as the point of rotation (pivot).



Andrzejef
14
Years of Service
User Offline
Joined: 26th Dec 2011
Location:
Posted: 8th May 2012 11:41 Edited at: 8th May 2012 14:54
Ok, many thanks. I've found what's wrong. I've just placed the commands into 'if'. So after the condition was done, thar returned to it's original position. Once again, thanks for advices.

Login to post a reply

Server time is: 2026-07-11 11:40:54
Your offset time is: 2026-07-11 11:40:54