News:

MFG's Character of the Month: October 2026 Nominations

Main Menu

tiling explods

Started by Websta, September 29, 2015, 03:36:33 PM

Previous topic - Next topic

Websta

Is there an easy way to make explods tile using some sort of math formula or something?

altoiddealer

Surely, but do you want them to positioned relative to the player?  Or relative to the screen?  Or other?

Mugen 1.0, or Mugen 1.1b?


Websta

Relative to the screen and mugen 1.1b

altoiddealer

Ok nvm, I can't help you there.
MUGEN 1.0 would be another story


Websta

Any help will be appreciated

Noctis

[State -1, Explod]
type = Explod
trigger1 = time%10=0
trigger1 = Time <= 999
anim = 9999
id = 9999
pos = 0+(time/10)*50,0+(time/10)*50
postype = front
scale = 1,1
sprpriority = 8
ignorehitpause = 1
ownpal = 1


^ It's positioned at 0. Spawns in increments of 10. Positions it based off of double the width or height which is set to 50 right now.
The width/height of everything is doubled in Mugen so the positioning (*50) needs to be double of whatever the image's width/height is outside of Mugen. If it's 30 by 30, then set it to

0+(time/10)*60,0+(time/10)*60

If you want it to be instant (no spawning in increments), then you'll have to mess with the coding. Specifically the Time%10=0 trigger and the +(Time/10) positioning. I didn't experiment any farther than this when making my Agrias.

Here's what it looks like in effect (first 5 seconds of the video).

(Youtube) (WIP) (Mediafire) (New Anime Shop) My Manga Reviews! Personal favorite Patreon! Check her out!

"There is nothing either good or bad, but thinking makes it so."

Алексей

The general formula you want is this:

x = x_offset + explod_width*numexplod(explod_id)


In terms of positioning relative to the screen, you could utilize ScreenPos. Have a helper positioned the way you want with a constant PosAdd and PosSet. PosSet for the X and PosAdd for the Y, but it depends where you want it so play around with that. Then the explods would be spawned from your helper, which is positioned relative to the screen.

-[Все слова это только слова.]-

altoiddealer

After a quick glance at the docs, I think I can help you here...

It depends a bit on whether you want the Explods to be affected by zoom.  If so, then your Explods would be created using parameter "space = stage" (which is default).  If not, then "space = screen."  If space = stage, you also need to consider that the Pos Y value is 0 the ground level (not the center of the screen, like Pos X)

You also need to consider that some users may be playing in widescreen, and others in fullscreen.  So you should note the height/width of your tiles, and make sure that your X and Y positioning is relative pixel-wise (opposed to being based exclusively on game/screen, width/height).

Example of placing 4 tiles in the center of the screen, which are 120 x 120 pixels, with a centered axis, and being affected by zoom...

Should be something like this as far as I can tell:

[State 1000,0] ;Bottom Left 120px X 120px Explod
type = Explod
trigger1 = time = 0
space = stage
pos = Floor((GameWidth/2)-60) , Floor(((GameHeight/2)-BottomEdge)-60)
anim = 1000

[State 1000,0] ;Top Left 120px X 120px Explod
type = Explod
trigger1 = time = 0
space = stage
pos = Floor((GameWidth/2)-60) , Floor(((GameHeight/2)-BottomEdge)+60)
anim = 1001

[State 1000,0] ;Bottom Right 120px X 120px Explod
type = Explod
trigger1 = time = 0
space = stage
pos = Floor((GameWidth/2)+60) , Floor(((GameHeight/2)-BottomEdge)-60)
anim = 1002

[State 1000,0] ;Top Right 120px X 120px Explod
type = Explod
trigger1 = time = 0
space = stage
pos = Floor((GameWidth/2)+60) , Floor(((GameHeight/2)-BottomEdge)+60)
anim = 1003


Websta


Noctis

I guess you should've been more clear about what it is you meant by tiling. There's many kinds of ways and mine is it's own type of tiling in it's simplest form.
Hope you can figure out what it is you need.

(Youtube) (WIP) (Mediafire) (New Anime Shop) My Manga Reviews! Personal favorite Patreon! Check her out!

"There is nothing either good or bad, but thinking makes it so."

XGargoyle

just keep in mind that there's a limit on the number of explods. A tiling system may hit that limit which will result in old explods disappearing to make room for the new ones


XGargoyle: Battle posing since 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
http://paypal.me/XGargoyle  <-- Donations welcome!