2 Questions

Previous topic - Next topic

Richard Rae

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?

Schranz0r

You want to change the Mousepointer on Collision ?

that very simple ;)

one moment again  :D
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

Schranz0r

http://www.styleattax.de/Pointer-change.rar

But the Spritenumber are different numbers ( 10 and 11)
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

Richard Rae

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.

Kitty Hello

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.

Richard Rae

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.

Kitty Hello

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.

Brice Manuel

QuoteAgain, SPRITE is not what you usually call a Sprite.
For game development on PCs, that IS a sprite.

QuoteI 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*

Schranz0r

but ther a no changes to load and draw a sprite!

still the same commands:

LOADSPRITE
SPRITE

GERNOT:
QuoteI will not change the sprite command, I just change it's name to "BLIT".
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

Kitty Hello

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.

Kitty Hello

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.

BumbleBee

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
The day will come...

CPU Intel(R) Core(TM) i5-3570k, 3.4GHz, AMD Radeon 7800 , 8 GB RAM, Windows 10 Home 64Bit

Schranz0r

And ja new seperate Blit command ?
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

Kitty Hello

What for? Sprite does "blit". But it does not "Sprite", know what I mean?

Schranz0r

Also das ist mir jetzt zu umständlich ^^

Thats confusing me ^^
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard