- Joined
- May 1, 2006
- Messages
- 4
Hi
I'm new to JASS, and I recently completed my first major function using JASS. I'm looking for evaluations of it so I can improve techniques.
Repel Trap Demo
The map itself is simple enough - a single hero that has the "Repel Trap" ability which will repel an enemy hero that comes near it. (Essentially it is DotA Tiny's Toss in the form of a trap.)
The trap repel (toss) is in the direction that your hero faces at the time when he plants the trap.
At levels 1 and 2 you're allowed one instance of the trap, at levels 3 and 4 you're allowed two. (Making it possible to have trap-chains).
The implementation is *supposed* to be fully multi-instantiable and leak-free.
What I think is interesting is the way I've handled trap-and-timer instantiation. Instead of creating/destroying traps as they get planted or activated, I recycle them, using the same units as trap and the same timers to check for trap activation. Traps also have an "age" associated with them, allowing me to replace the oldest trap with a new one when the ability is activated.
I'm new to JASS, and I recently completed my first major function using JASS. I'm looking for evaluations of it so I can improve techniques.
Repel Trap Demo
The map itself is simple enough - a single hero that has the "Repel Trap" ability which will repel an enemy hero that comes near it. (Essentially it is DotA Tiny's Toss in the form of a trap.)
The trap repel (toss) is in the direction that your hero faces at the time when he plants the trap.
At levels 1 and 2 you're allowed one instance of the trap, at levels 3 and 4 you're allowed two. (Making it possible to have trap-chains).
The implementation is *supposed* to be fully multi-instantiable and leak-free.
What I think is interesting is the way I've handled trap-and-timer instantiation. Instead of creating/destroying traps as they get planted or activated, I recycle them, using the same units as trap and the same timers to check for trap activation. Traps also have an "age" associated with them, allowing me to replace the oldest trap with a new one when the ability is activated.