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! / Sprite priority over pasted images - Please, someone, come up with a solution!

Author
Message
3ddd
21
Years of Service
User Offline
Joined: 14th Apr 2004
Location: Orlando, FL
Posted: 30th Aug 2004 07:59 Edited at: 30th Aug 2004 08:00

See how the Pirahna Plant is overlayed on the green pipe? The Pirahna Plant is a sprite and the pipe is constructed from image tiles using the Paste Image command. Only the part of the Pirahna Plant that is outside of the pipe should be showing.
Any ideas on how to do this? Pleeeease!

The only somewhat reasonable idea I have is to make a sprite shaped like the pipe and set it to a higher priority. I think it's a pretty dumb idea, but it's all I got.

The complete code is posted here
http://forum.thegamecreators.com/?m=forum_view&t=37129&b=8


He's evil, but, he'll die. I like it.
pizzaman
21
Years of Service
User Offline
Joined: 18th Feb 2004
Location: Gateshead, UK
Posted: 30th Aug 2004 08:33 Edited at: 30th Aug 2004 08:34
hi

Just use the paste sprite command, as long as you paste the sprite to screen before the pipe tiles, and after the sky tiles are drawn to screen, you'll see your plant. Also if you want sprite collision for the plant but don't want to see it, use the hide sprite commands.

pizzaman
3ddd
21
Years of Service
User Offline
Joined: 14th Apr 2004
Location: Orlando, FL
Posted: 30th Aug 2004 08:40 Edited at: 30th Aug 2004 08:41
Sounds good! Ug... it will require a bit to implement but I will try it. Thanks!


He's evil, but, he'll die. I like it.
3ddd
21
Years of Service
User Offline
Joined: 14th Apr 2004
Location: Orlando, FL
Posted: 30th Aug 2004 13:00
Pizzaman, that worked great! Thanks for the idea! I never thought about using paste sprite. It wasn't even too hard to do. Check out the exe if you'd like: [href]http://home.earthlink.net/~3ddd/mario.zip
[/href]

I don't think collision still worked after I hid the sprite, though. Are you sure it is supposed to?


He's evil, but, he'll die. I like it.
pizzaman
21
Years of Service
User Offline
Joined: 18th Feb 2004
Location: Gateshead, UK
Posted: 31st Aug 2004 00:02
Hi

Collision should still work on the sprite if its hidden, however collision does not work on the image produced from the paste sprite command, because its just an image of the sprite, therefore to get a collision for the pasted sprite, if you put the actual sprite at the same coordinates as the pasted sprite, you'll get a collision on that sprite (make sure you hide the sprite or you'll get that graphical glitch)

Here is some code to show what I mean


btw your game looks good, just a few suggestions though, make the jump button the up arrow key, and tinker with the movement system for mario, at the moment it doesn't handle as "natural" ??? as the original game.

Keep up the good work
pizzaman
3ddd
21
Years of Service
User Offline
Joined: 14th Apr 2004
Location: Orlando, FL
Posted: 31st Aug 2004 05:10
Thanks so much for the demo program. Very kind of you to do that! Like you said, I need to make sure I put the hidden sprite where I am pasting it. It will be nice to get the built in collision to work because I had to write a ridiculusly long if..then to do it otherwise!
Also, thanks for the feedback. I will work on the "ease of use" factor in the controls. I like "z" for jumping becuase it is right next to "shift" for running.


He's evil, but, he'll die. I like it.
3ddd
21
Years of Service
User Offline
Joined: 14th Apr 2004
Location: Orlando, FL
Posted: 31st Aug 2004 23:02
Cool, collision with it works now! I hide the sprite, then use the sprite command as usual to place it where it needs to be, then I use the paste sprite command. Thanks again


He's evil, but, he'll die. I like it.

Login to post a reply

Server time is: 2025-05-15 23:45:19
Your offset time is: 2025-05-15 23:45:19