Author Topic: 2 Questions  (Read 4494 times)

Offline Richard Rae

  • Mr. Drawsprite
  • **
  • Posts: 79
    • View Profile
2 Questions
« 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?

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 5014
  • O Rly?
    • View Profile
2 Questions
« Reply #1 on: 2007-Apr-22 »
You want to change the Mousepointer on Collision ?

that very simple ;)

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

PC:
AMD RYzen 7 1700 @3.9Ghz, 16GB HyperX Fury 2666Mhz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 5014
  • O Rly?
    • View Profile
2 Questions
« Reply #2 on: 2007-Apr-22 »
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 1700 @3.9Ghz, 16GB HyperX Fury 2666Mhz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline Richard Rae

  • Mr. Drawsprite
  • **
  • Posts: 79
    • View Profile
2 Questions
« Reply #3 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.

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10697
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
2 Questions
« Reply #4 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.

Offline Richard Rae

  • Mr. Drawsprite
  • **
  • Posts: 79
    • View Profile
2 Questions
« Reply #5 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.

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10697
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
2 Questions
« Reply #6 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.

Brice Manuel

  • Guest
2 Questions
« Reply #7 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*

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 5014
  • O Rly?
    • View Profile
2 Questions
« Reply #8 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".
I <3 DGArray's :D

PC:
AMD RYzen 7 1700 @3.9Ghz, 16GB HyperX Fury 2666Mhz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10697
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
2 Questions
« Reply #9 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.

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10697
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
2 Questions
« Reply #10 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.

Offline BumbleBee

  • Global Moderator
  • Prof. Inline
  • *******
  • Posts: 891
    • View Profile
2 Questions
« Reply #11 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
The day will come...

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

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 5014
  • O Rly?
    • View Profile
2 Questions
« Reply #12 on: 2007-Apr-24 »
And ja new seperate Blit command ?
I <3 DGArray's :D

PC:
AMD RYzen 7 1700 @3.9Ghz, 16GB HyperX Fury 2666Mhz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10697
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
2 Questions
« Reply #13 on: 2007-Apr-24 »
What for? Sprite does "blit". But it does not "Sprite", know what I mean?

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 5014
  • O Rly?
    • View Profile
2 Questions
« Reply #14 on: 2007-Apr-24 »
Also das ist mir jetzt zu umständlich ^^

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

PC:
AMD RYzen 7 1700 @3.9Ghz, 16GB HyperX Fury 2666Mhz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard