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.

2D All the way! / Rotating spirites?

Author
Message
Kanzure
21
Years of Service
User Offline
Joined: 19th Feb 2003
Location:
Posted: 6th Apr 2003 21:52
I'm making a game that uses spirites (woah..surprise?) and I want them to be able to rotate..I only have the up, down, left, and right positions, but how can I just "rotate" the top one to make it look like its the left, right, and bottom?

Possible?


Is ther a program that can do this if thats not possible?
~Morph
Owner of MultiCode.NET and Multi2k.NET.
Nothing is something, and something is then nothing. Life is an illusion.
bushsucks
21
Years of Service
User Offline
Joined: 8th Mar 2003
Location: United States
Posted: 7th Apr 2003 02:09
I wouldn't mind having an answer to this question, too. There's a rotate sprite command you can use with DB Pro, but if you're like me and have DB classic, you would probably have to use lots of confusing math crap (which I don't want to do, that's why I got DB)

don't re-elect bush
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 7th Apr 2003 10:30
If you have two images, one facing up and the other facing left, you can flip or mirror to get the other two.

If you actually want rotation then you can create a 3D plain and texture that with your sprite image, then rotate around the z-axis. You will lose the sprite collision detection this way though.
EightYearRecoil
21
Years of Service
User Offline
Joined: 7th Apr 2003
Location: United States
Posted: 7th Apr 2003 10:47
I just bought DB v1.12, and in my book it says there is the hidden command to rotate an image in degrees of 0, 90, 180, and 270.

ROTATE IMAGE Image Number, Degree

I haven't use it yet, I just made a seperate image with paint that rotated my image where I wanted it. Also, I don't know if that would work with the downloaded version of the program.

ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 7th Apr 2003 21:19
problem with the rotate image command is that it wouldn't affect a SPRITE becasue an image and a sprite are different things.

'You were born crying while people around you smiled'
indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 8th Apr 2003 08:15
a 3d sprite unlocks all the 3d commands for access to manipulate your pusedo sprite plains.



Richard Davey
Retired Moderator
21
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 8th Apr 2003 12:46
Red Eye - sprites use active images however. If you modified an image that a sprite was using, it would change the next time the sprite was called.

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 8th Apr 2003 23:12
ok thanks rich.
so would something like this work?

only when i try it pressing the rightkey causes the sprite to dissapear, or am i missing something???

'You were born crying while people around you smiled'
EightYearRecoil
21
Years of Service
User Offline
Joined: 7th Apr 2003
Location: United States
Posted: 9th Apr 2003 01:30
I just checked my book, and it says the rotate image command only works if it's supported by the hardware. When I tried it it didn't work on my computer.

8YR

bushsucks
21
Years of Service
User Offline
Joined: 8th Mar 2003
Location: United States
Posted: 10th Apr 2003 23:16
i experienced the same problem as red_eye, the sprite disappears when you rotate the image, so does this mean that it's not supported by the hardware, and if so, is there a way to get it so that it is supported? Also, are there any other "hidden commands" like rotate image

don't re-elect bush
indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 12th Apr 2003 02:59
if your going to do the 3d method then this was the hardest part to work out.

Width = Screen Width()/2
Height = Screen Height()/2
Z# = Screen Height()*0.83

Someone posted it a while back, It helps to stop objects from distorting at the tops and bottom and to place them at the center of the screen.


this opens up all the 3d commands and that will cover more machines.

Vice
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location:
Posted: 15th Apr 2003 23:34
Assumin ur usin the 3D method:

My image is an irregular shape (an airplane), how do u make it so that on the 3D plane, only the plane shows up? The background also shows, but using sprites u can set the transparency mode so that it doesnt show up the colour black(or white i think). Is there a transparency mode for the 3D plane so it doesnt show up black?
Danmatsuma
21
Years of Service
User Offline
Joined: 2nd Mar 2003
Location: Australia
Posted: 16th Apr 2003 08:26
This is what you need to do to your 3D plain object, and make sure it's black you use as the key color.


ZX Spectrum 48k Issue 3, Radio shack Tape drive, Rank arena 12" T.V. set.
Vice
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location:
Posted: 16th Apr 2003 19:57
Thnx Danmatsuma. How do fix the problem when it says "Error at line whatever, specified angle must be 0 to 360 degrees"? Im sure ive seen the answer sumwhere else on this forum.
Morales
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: - Please Select -
Posted: 16th Apr 2003 21:50
you know most of the people posting know how to rotate a sprite
they just wont tell you! this is knot the way to do it this
will give you an idea so you could do it your self and thats the way
programers should be.

use the comand [set sprite texture coord] also use the tutorial
number (1) this should show you how to use this comand

the other ways are good but this way you could use a sprite than a
image or object.
Morales
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: - Please Select -
Posted: 16th Apr 2003 21:55
use the [set sprite texture coord]
and you try to get the sprite to rotate.
Steven Craft
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location:
Posted: 30th Apr 2003 06:10
In short I do NOT believe dark basic [CLASSIC] has a SPRITE rotate command, (maybe it has rotate for images or what ever, but not for sprite).

A common way to get around this is to rotate the image externally and save it to an image sequence, not ideal but possibly the best bet.

I'd think by now someone would have written a dll or some sort of module that darkbasic can use to rotate a sprite, I did consider looking into this, but the only way I could think of doing it would be to basically open up the image file, for example the bitmap, then manipulate the data inside it, (in the same way an image editor would) then display this image on the screen and use get image, then assign this image to the sprite, however I realised this would be a BIG task, and also would only work for one image format, for other formats are encoded differently. However if i get a spare few days in the near future I'll take a look at the possibility of writing a dll to achieve this.

I'd be interested if anyone has any other ideas of how to do this, or if there is a dll or similiar already in existance.

Steve

CloseToPerfect
21
Years of Service
User Offline
Joined: 20th Dec 2002
Location: United States
Posted: 30th Apr 2003 07:17
what about the sprite commands by underwaredesign?
I do have classic but I thought I've seen people say his had rotate?
maybe,maybe not.
CTP

Login to post a reply

Server time is: 2024-04-27 03:21:58
Your offset time is: 2024-04-27 03:21:58