Discuss Scratch

Wtib2013
New Scratcher
17 posts

Mario (strolling) game

https://scratch.mit.edu/projects/418658012/editor/

I have start of a strolling Mario game and I am trying to get the movements between mario and the blocks to work right. It has the basic StrollX movement, where I create the CLONES of BLOCKS, and change STROLL X as mario moves left and right. The BLOCKS only appear when Stroll X is between 240 and - 240. That is working fine.

My problem is the interaction with individual clones. I want when Mario is Small, if Mario touches certain bricks, they move up 3 spaces, and then move back down. So I have
whenIstartasacloneforeveriftouchingMARIO?thenchangeyby3wait.2secschangeyby-3

However, this doesn't work. Is this because the create the clone incorrectly and Mario's touching of the clone isnt registering somehow?

Note: I am still new to scratch, so not sure if I am using the discussion right. If not, sorry. Also, if there is better tools (books, etc), you recommend, please point me to them.

thanks
Admiral_X
Scratcher
35 posts

Mario (strolling) game

Are you using a separate hitbox than the Mario sprite? If you do the hitbox will block the Mario sprite from touching the block. If you have any questions please ask!
Wtib2013
New Scratcher
17 posts

Mario (strolling) game

Thanks Admiral X. Still learning how to respond to people, so hoping you get this. I don't understand your reference to HitBox. I have a mario collider, which i use for to keep me walking, but it at the feet of Mario. The blocks and mario should be touching, so i don't understand your question.

My thought is there something wrong with how i built or coded the clones in the block sprite, so they are not registering when Mario touches them, or something. That being said, I have code that says when Mario touches the BLOCK, change velocity to push them down. So Mario doesn't go through the box. Maybe that causing my second code (although they are not sequenced) to not work??
Admiral_X
Scratcher
35 posts

Mario (strolling) game

Can you give me the link to the project? I need specifics.
game-titan
Scratcher
79 posts

Mario (strolling) game

Wtib2013 wrote:

https://scratch.mit.edu/projects/418658012/editor/

By the way, this is a link to Asteroids v6, not a Mario game.
Wtib2013
New Scratcher
17 posts

Mario (strolling) game

I apologize for including the wrong link initially, and have included the mario game

https://scratch.mit.edu/projects/419724073/editor/

However, in trying to fix things, I now have bigger problems. Unfortunately, this was put down, so i must have forgotten some of what I did, and will need to start over (in part). Mario is now landing inside blocks, and falling through.

What I want to do will is mostly described in my custom blocks.

(1) In Mario, Effects of Gravity block - it is always pushing down if I not
touchingTilesv?
; If I am touching a tile, my gravity changes.
- If Gravity is greater than 1 (I'm going up), the speed changes by multiplying by -1. (I want it to bounce off the block)
- If Gravity is less than -1 (I'm going down), the speed changes by multiplying by -0.5 (I want it to reduce it bounce)
- Else (if between 1 and -1), it goes to zero

(2) Also in Mario is a bouncing off walls, that is similar (the problem here was if I hit the platforms when jumping, I'd end up inside them)

These both should exist for Small Mario, but wouldnt exist for BIG Mario. I think Big Mario will work like little mario, except for a SPECIFIC Custom of Tiles, which I call WALLS.

Last edited by Wtib2013 (Sept. 3, 2020 22:35:08)

Powered by DjangoBB