GLBasic forum

Main forum => GLBasic - en => Topic started by: Richard Rae on 2007-Apr-21

Title: 2 Questions
Post by: Richard Rae on 2007-Apr-21
Hi again.I was wondering if there is any way to change the image of a sprite at runtime(same sprite id different image)?Also,if I had a pointer sprite how do you return the id of a sprite that it has collided with?
Title: 2 Questions
Post by: Schranz0r on 2007-Apr-22
You want to change the Mousepointer on Collision ?

that very simple ;)

one moment again  :D
Title: 2 Questions
Post by: Schranz0r on 2007-Apr-22
http://www.styleattax.de/Pointer-change.rar

But the Spritenumber are different numbers ( 10 and 11)
Title: 2 Questions
Post by: Richard Rae on 2007-Apr-22
Not quite what I meant.Say you had several sprites on screen and a ball(similar to arkanoid).If the ball hits a sprite is there any way of returning the number of the sprite that was hit.Hope this is clearer.
Title: 2 Questions
Post by: Kitty Hello on 2007-Apr-23
Ah. OK. You have to test for some collisions explicitly, and see what hits the ball. Then you know that ID and can use it.

Again, SPRITE is not what you usually call a Sprite. It's more a BLIT ir IMAGE command. I will change this now, it's much too confusing people.
Title: 2 Questions
Post by: Richard Rae on 2007-Apr-23
Thanks for the reply Gernot.Any idea when this will be implemented?Also is there any way that a sprite could have multiple images that could be chosen ?Great programme by the way.
Title: 2 Questions
Post by: Kitty Hello on 2007-Apr-23
I will not change the sprite command, I just change it's name to "BLIT".
For multiple images, there's some code here on the forum. Search the code snippets, IIRC.
Title: 2 Questions
Post by: Brice Manuel on 2007-Apr-24
Quote
Again, SPRITE is not what you usually call a Sprite.
For game development on PCs, that IS a sprite.

Quote
I just change it's name to "BLIT".
That is going to be confusing for people wanting to write games.

*mumbles about rewriting my GLBasic tutorials*
Title: 2 Questions
Post by: Schranz0r on 2007-Apr-24
but ther a no changes to load and draw a sprite!

still the same commands:

LOADSPRITE
SPRITE

GERNOT:
Quote
I will not change the sprite command, I just change it's name to "BLIT".
Title: 2 Questions
Post by: Kitty Hello on 2007-Apr-24
The main problem we are facing here is, that "sprite" usually defines a pixel image, that you place somewhere, and it stays there until you move/remove it.
However, the GLBasic SPRITE commands don't do that. They just "draw" the image you loaded to the back buffer and set. After a SHOWSCREEN, there's no image anywhere standing. And this is confusing people. It's the name "SPRITE" that implies a different behaviour.
Title: 2 Questions
Post by: Kitty Hello on 2007-Apr-24
The main problem we are facing here is, that "sprite" usually defines a pixel image, that you place somewhere, and it stays there until you move/remove it.
However, the GLBasic SPRITE commands don't do that. They just "draw" the image you loaded to the back buffer and set. After a SHOWSCREEN, there's no image anywhere standing. And this is confusing people. It's the name "SPRITE" that implies a different behaviour.
Title: 2 Questions
Post by: BumbleBee on 2007-Apr-24
Hi

Blit (Bit Block Transfer) exactly means ->copying memory from here to there  (or copy image from here to there).:)

Sprites are nothing but 2D pictures often used with a colorkey. 3D Sprites (called Billboards) are 2D pictures, rendered in a 3D world. In other game programming languages there are sprite commands too.

You must not change it to Blit. But that's up to you, Gernot.:)

Cheers
Title: 2 Questions
Post by: Schranz0r on 2007-Apr-24
And ja new seperate Blit command ?
Title: 2 Questions
Post by: Kitty Hello on 2007-Apr-24
What for? Sprite does "blit". But it does not "Sprite", know what I mean?
Title: 2 Questions
Post by: Schranz0r on 2007-Apr-24
Also das ist mir jetzt zu umständlich ^^

Thats confusing me ^^