Discuss Scratch

Koamodo975
Scratcher
1000+ posts

math oh my god

https://scratch-mit-edu.ezproxyberklee.flo.org/projects/1123750499/ link here
so i dunno if anyone remembers but yesterday i made a topic about this roguelike thing im making, now i need help again. the sword is supposed to be held ‘over the shoulder/hip’(if you don't know what I mean you could look at either griffpatch's hack and slash development video or at this) anyway the problem is im using a different system for the body parts so that won't work(also i'm now trying griff's system just using a series of positions for it to clip to). i have no idea how to calculate where the sword should be or how it should rotate, anyone know how to do this?
I also have to figure out how to reverse-engineer the x and y direction code so the aimer points in the right direction.

Last edited by Koamodo975 (Feb. 5, 2025 20:38:50)

Koamodo975
Scratcher
1000+ posts

math oh my god

bump
JoeyjJoe
Scratcher
100+ posts

math oh my god

I'm not entirely sure what you're looking help for, but maybe try setting the sword to be at the players x and y pos and add an offset to tune it to your specific wishes
Koamodo975
Scratcher
1000+ posts

math oh my god

JoeyjJoe wrote:

I'm not entirely sure what you're looking help for, but maybe try setting the sword to be at the players x and y pos and add an offset to tune it to your specific wishes
yeah I know, but I dunno how to calculate where the sword should be.
JoeyjJoe
Scratcher
100+ posts

math oh my god

Koamodo975 wrote:

JoeyjJoe wrote:

I'm not entirely sure what you're looking help for, but maybe try setting the sword to be at the players x and y pos and add an offset to tune it to your specific wishes
yeah I know, but I dunno how to calculate where the sword should be.
maybe give the sword its own x y var and make it its own entity?
Koamodo975
Scratcher
1000+ posts

math oh my god

JoeyjJoe wrote:

Koamodo975 wrote:

JoeyjJoe wrote:

I'm not entirely sure what you're looking help for, but maybe try setting the sword to be at the players x and y pos and add an offset to tune it to your specific wishes
yeah I know, but I dunno how to calculate where the sword should be.
maybe give the sword its own x y var and make it its own entity?
Consider it as a last resort, but I'm tryna keep everything in one sprite since some enemies will have weapons.
s714655
Scratcher
100+ posts

math oh my god

Not sure what your trying to do but just make the sword go to player, point towards mouse, and move distance steps. loop
WofyWritesHugeRPBios
Scratcher
100+ posts

math oh my god

Koamodo975 wrote:

https://scratch-mit-edu.ezproxyberklee.flo.org/projects/1123750499/ link here
so i dunno if anyone remembers but yesterday i made a topic about this roguelike thing im making, now i need help again. the sword is supposed to be held ‘over the shoulder/hip’(if you don't know what I mean you could look at either griffpatch's hack and slash development video or at this) anyway the problem is im using a different system for the body parts so that won't work(also i'm now trying griff's system just using a series of positions for it to clip to). i have no idea how to calculate where the sword should be or how it should rotate, anyone know how to do this?
I also have to figure out how to reverse-engineer the x and y direction code so the aimer points in the right direction.
A way you can do this is by putting the player at a specific position (0,0, is a good one) and then put the sword sprite where you want it to be. Look at the swords X and Y, then calculate the distance the X is from the players X and the Y is from the players Y. Then, finally, make the sword go to the player and change X by your calculated X number and change Y by your calculated Y number in a forever loop. You can use a variable to change the position the sword is in by using “If” blocks as well.

Last edited by WofyWritesHugeRPBios (Feb. 6, 2025 19:38:48)

JoeyjJoe
Scratcher
100+ posts

math oh my god

Koamodo975 wrote:

JoeyjJoe wrote:

Koamodo975 wrote:

JoeyjJoe wrote:

I'm not entirely sure what you're looking help for, but maybe try setting the sword to be at the players x and y pos and add an offset to tune it to your specific wishes
yeah I know, but I dunno how to calculate where the sword should be.
maybe give the sword its own x y var and make it its own entity?
Consider it as a last resort, but I'm tryna keep everything in one sprite since some enemies will have weapons.
you could make the sword x and y a local variable and have it as a clone
Koamodo975
Scratcher
1000+ posts

math oh my god

JoeyjJoe wrote:

Koamodo975 wrote:

JoeyjJoe wrote:

Koamodo975 wrote:

JoeyjJoe wrote:

I'm not entirely sure what you're looking help for, but maybe try setting the sword to be at the players x and y pos and add an offset to tune it to your specific wishes
yeah I know, but I dunno how to calculate where the sword should be.
maybe give the sword its own x y var and make it its own entity?
Consider it as a last resort, but I'm tryna keep everything in one sprite since some enemies will have weapons.
you could make the sword x and y a local variable and have it as a clone
well it does have it's own x and y, it's just the hand x-y because they're together. The real problem is actually figuring out what value the variables should have, since I'm not good at math like this.
Koamodo975
Scratcher
1000+ posts

math oh my god

ahrm koff koff
Koamodo975
Scratcher
1000+ posts

math oh my god

le bumo

Last edited by Koamodo975 (Feb. 12, 2025 19:05:17)

Koamodo975
Scratcher
1000+ posts

math oh my god

bump
Koamodo975
Scratcher
1000+ posts

math oh my god

ello
Koamodo975
Scratcher
1000+ posts

math oh my god

BUMP
Koamodo975
Scratcher
1000+ posts

math oh my god

the honorable prince bumpo returns

Powered by DjangoBB