Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: Derf321 on January 07, 2013, 05:33:37 pm

Title: Best way to make a star shaped bullet?
Post by: Derf321 on January 07, 2013, 05:33:37 pm
I'd like to make a gun shoot star shaped bullets (basically the * sign, its the wunderwaffe from Nazi Zombies). What do you think the best approach to this would be to make it detect wall/zombie collisions? I'd prefer small size over fast speed. Should I use a sprite? Just Text(x,y,"*")? Just pixels turning on? Help is appreciated!  :)
Title: Re: Best way to make a star shaped bullet?
Post by: blue_bear_94 on January 07, 2013, 06:22:19 pm
The Text command will erase the space below the star. So using a sprite is the best bet.
Title: Re: Best way to make a star shaped bullet?
Post by: Sorunome on January 07, 2013, 06:34:36 pm
To create the sprite you can use many tools that already exist e.g. pixelscape (http://clrhome.org/pix/)
Title: Re: Best way to make a star shaped bullet?
Post by: Derf321 on January 07, 2013, 11:37:23 pm
To create the sprite you can use many tools that already exist e.g. pixelscape (http://clrhome.org/pix/)
Thats a pretty sweet tool, I was hoping there was one out there like that. Would I have to then run a pixel test for each pixel on the sprite or is there like a sprite collision test command?
Title: Re: Best way to make a star shaped bullet?
Post by: AngelFish on January 07, 2013, 11:44:07 pm
To create the sprite you can use many tools that already exist e.g. pixelscape (http://clrhome.org/pix/)
Thats a pretty sweet tool, I was hoping there was one out there like that. Would I have to then run a pixel test for each pixel on the sprite or is there like a sprite collision test command?

You can, but there's a much easier way to do things given the simple constraint that the sprite can tessellate.

Take a look at the section "Mouse matters" here (http://www.gamedev.net/page/resources/_/technical/game-programming/isometric-n-hexagonal-maps-part-i-r747)

To do a collision with any sprite that can tessellate, you just need figure out what overlaps with specified regions in a rectangle. That can easily be done with bitmasking, if you're creative.
Title: Re: Best way to make a star shaped bullet?
Post by: Keoni29 on January 08, 2013, 07:34:21 am
Sprites are faster than text right?
Title: Re: Best way to make a star shaped bullet?
Post by: Derf321 on January 08, 2013, 12:57:48 pm
You can, but there's a much easier way to do things given the simple constraint that the sprite can tessellate.

Take a look at the section "Mouse matters" here (http://www.gamedev.net/page/resources/_/technical/game-programming/isometric-n-hexagonal-maps-part-i-r747)

To do a collision with any sprite that can tessellate, you just need figure out what overlaps with specified regions in a rectangle. That can easily be done with bitmasking, if you're creative.

I guess I'm not that creative, because I don't really understand it =P  How do I apply the "Mouse matters" stuff into my game? My game isn't a tilemap by the way
Title: Re: Best way to make a star shaped bullet?
Post by: AngelFish on January 08, 2013, 01:01:14 pm
Imagine the mouse is the object you want to test collision with and the white tile is the star shaped bullet. If the mouse is in any of the colored areas, no collision. If it's in the white area, collision.
Title: Re: Best way to make a star shaped bullet?
Post by: Derf321 on January 08, 2013, 10:53:43 pm
Imagine the mouse is the object you want to test collision with and the white tile is the star shaped bullet. If the mouse is in any of the colored areas, no collision. If it's in the white area, collision.
I still don't really understand how this applies to a pixel-and-line based game though, I see how it would apply to a isometric map though
Title: Re: Best way to make a star shaped bullet?
Post by: Derf321 on January 13, 2013, 04:26:21 am
Can anyone explain? I'd like to learn