Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ball reverts its z direction when it hits a z maxima/minima
#1
So my question goes:
How do I make a ball which is moving in the z-axis bounces back (in the z-axis) upon reaching a z-boundary?
Thanks in advance.
[Image: signature.png]
A-Engine: A new beat em up game engine inspired by LF2. Coming soon

A-Engine Dev Blog - Update #8: Timeout

Reply
Thanks given by:
#2
What do you exactly want to make? Do you mind explaining it more?
...............
Reply
Thanks given by:
#3
Hmph:
The character shoots a ray of light which travels diagonally in the z-axis, and upon reaching a z-axis end, the ray reflects and starts moving toward the other z end. Here is a sketch:
[Image: untitl10.png]
[Image: signature.png]
A-Engine: A new beat em up game engine inspired by LF2. Coming soon

A-Engine Dev Blog - Update #8: Timeout

Reply
Thanks given by:
#4
hmmm.. i am not sure if this works but this might give you an idea what to do:
you could do two things, either let your char spawn two objects who follow the ray of light and make it go to a special frame with dvz: -xxx basically the opposite of what it got to be at that positions (i am not sure if i explained it well there :S ). In other words you have two way of letting your ray of light move.. one is diagonally down and one is up. If the ray hits the object which is placed at the bottom the ray of light should move up and vice versa.

Another way i could think of is modifying the bgs, you put 2 objects on each end of the z boundaries (having the size of the whole bg length, that would be y no?) and let them get the ray of light to a special frame as described earlier.

Method 1 could be a nice gimmick, where you put 2 mirrors and then your ray of light goes mad on them :D

Well i have no idea if any of those two work correctly, but i know that you are smart so you might figure out something from just that!

[sig placeholder until my new sig is finished]
should totally allow people to be all trolley on their birthday :D
Reply
Thanks given by: A-Man
#5
In theory:
1) ball holds an invisible char, where the char has a zwidth: 1 or 2 (experiment with this)
2) in the rebound frames, ball will have two ik8s -> higher up in z axis = go to frame to travel downwards in z axis, lower in z axis = go to frame to travel upwards
(if you think about it, if the rebounded ball is lower, then the upper ik8 will interact, so you want to go down because the original ball was higher in z axis)

that's in theory though, Yinyin got this behaviour nearly working (had some issue with the hit sound happening twice), he might give you a better answer/method. I believe you can do this with wpoints as well and get rid of ik8



better theory, and i believe this is what yinyin used:
in the ball flying upwards in z-axis frames, it must hold onto a ball flying downwards as a weapon (invisible), and when it gets hit, it releases that downwards flying ball, which opoints a ball flying upwards and held as a weapon.



Azriel~
Reply
Thanks given by: A-Man , Hero destroyer
#6
I don't actually remember doing this ever, but I really like the idea and it shouldn't be too difficult depending on how flexible the blast should be.

By that I mean: Should you be able to rebound this thing normally? Also should it go straight like Woodys blasts after a rebound or back up/down the way it came from?
Either way I would suggest you to not use any character objects or even wpoints as both can get pretty messy on normal blasts.
I'd rather suggest you to use hit_a/d timers in combination with a self hit upon not moving along z any more (border condition) to set that case apart from the normal hit/hitting/rebound actions.
Also use two objects - one for flying up and one for flying down.

edit: If you don't want to set apart border/hit/hitting/rebound actions and make the blast bounce of characters the way it does on walls it would be even easier and you only have to do the self hit upon 0 z movement. Any interaction would make the blast change z direction.
(about the z condition: just make the blast constantly spawn an object that waits long enough for the blast to get away on z axis before it goes to a frame that would hit it)
Reply
Thanks given by: A-Man
#7
All I can think of is that:

All backgrounds in your mod has the same z boundary.
Make a weapon that has a high dvz value and its hp should be equal to it hp injury.
When it hit the ground at the z boundary maxima, it releases a ball.
The ball's first few frames has negative dvz values(till it reaches z minimum, work with that) and later frames has high dvz values till it reaches the z maxima and then repeat it again.

You'll have to work with this.

I think you should cancel this move for your mod as you might need to change all your bg. If this works then go for it.

@Azriel
I tried your first theory but it didn't work.
...............
Reply
Thanks given by: A-Man
#8
@Davis: Hmph, don't think you got my problem. Nevertheless, Thanks :)

@Others: Thanks Y'all! What I did was in case someone faces the same problem someday and decides to search:
1-Opointed 2 state 18' "mirrors" with an itr of a special y-value.
2-Made 2 state 3000' objects, each moving in +,- z-direction respectively. Each object is in a separate dat file, and each has a bdy of the same special y-value I gave for the itr.
3-The 2 frame 20(s) for each ball opoints the one of the other direction. And this way, I can save frame 30 (rebound) and 10 (hitting) for other uses.

~Solved.
[Image: signature.png]
A-Engine: A new beat em up game engine inspired by LF2. Coming soon

A-Engine Dev Blog - Update #8: Timeout

Reply
Thanks given by:
#9
should totally make an study example out of it and post it here!
(some people learn by seeing it first hand)
[sig placeholder until my new sig is finished]
should totally allow people to be all trolley on their birthday :D
Reply
Thanks given by:
#10
(06-20-2013, 10:24 AM)The Lost Global Mod Wrote:  should totally make an study example out of it and post it here!
(some people learn by seeing it first hand)
Alright! I've always wanted to contribute something to this community, and I guess that's something I can contribute with. Thanks :)

@v: Sir, YES SIR! Just give me sometime so that I do it as a move for template and prepare it in the same form as the other tuts in the main site.

Silverthorn edited this post 06-20-2013 03:52 PM because:
If you don't mind, I'd probably even be bothered to submit it to the mainsite :p
[Image: signature.png]
A-Engine: A new beat em up game engine inspired by LF2. Coming soon

A-Engine Dev Blog - Update #8: Timeout

Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)