Author Topic: Best way to make a star shaped bullet?  (Read 4141 times)

0 Members and 1 Guest are viewing this topic.

Offline Derf321

  • LV3 Member (Next: 100)
  • ***
  • Posts: 59
  • Rating: +0/-0
    • View Profile
Best way to make a star shaped bullet?
« 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!  :)

Offline blue_bear_94

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 801
  • Rating: +25/-35
  • Touhou Enthusiast / Former Troll / 68k Programmer
    • View Profile
Re: Best way to make a star shaped bullet?
« Reply #1 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.
Due to dissatisfaction, I will be inactive on Omnimaga until further notice. (?? THP hasn't been much success and there's also the CE. I might possibly be here for a while.)
If you want to implore me to come back, or otherwise contact me, I can be found on GitHub (bluebear94), Twitter (@melranosF_), Reddit (/u/Fluffy8x), or e-mail (if you know my address). As a last resort, send me a PM on Cemetech (bluebear94) or join Touhou Prono (don't be fooled by the name). I've also enabled notifications for PMs on Omnimaga, but I don't advise using that since I might be banned.
Elvyna (Sunrise) 4 5%
TI-84+SE User (2.30 2.55 MP 2.43)
TI-89 Titanium User (3.10)
Casio Prizm User? (1.02)
Bag  東方ぷろの

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Best way to make a star shaped bullet?
« Reply #2 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/)

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Derf321

  • LV3 Member (Next: 100)
  • ***
  • Posts: 59
  • Rating: +0/-0
    • View Profile
Re: Best way to make a star shaped bullet?
« Reply #3 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?

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Best way to make a star shaped bullet?
« Reply #4 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

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.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: Best way to make a star shaped bullet?
« Reply #5 on: January 08, 2013, 07:34:21 am »
Sprites are faster than text right?
If you like my work: why not give me an internet?








Offline Derf321

  • LV3 Member (Next: 100)
  • ***
  • Posts: 59
  • Rating: +0/-0
    • View Profile
Re: Best way to make a star shaped bullet?
« Reply #6 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

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

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Best way to make a star shaped bullet?
« Reply #7 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.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Derf321

  • LV3 Member (Next: 100)
  • ***
  • Posts: 59
  • Rating: +0/-0
    • View Profile
Re: Best way to make a star shaped bullet?
« Reply #8 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

Offline Derf321

  • LV3 Member (Next: 100)
  • ***
  • Posts: 59
  • Rating: +0/-0
    • View Profile
Re: Best way to make a star shaped bullet?
« Reply #9 on: January 13, 2013, 04:26:21 am »
Can anyone explain? I'd like to learn