Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    2d skateboard game

    Beginners
    18
    149
    20188
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • waldron
      waldron F @lawyerlounge last edited by

      @lawyerlounge i thought about this route but think its above my coding experience il look into it
      im only 3 weeks in to coding.

      1 Reply Last reply Reply Quote 1
      • waldron
        waldron F last edited by

        thinking if i just plotted my player in the middle no gravity then i can freely move and just have gravity for jump and have collide at the bottom and top

        1 Reply Last reply Reply Quote 0
        • lawyerlounge
          lawyerlounge last edited by lawyerlounge

          what do you mean by "in the middle NO gravity" and then "just HAVE gravity for jump"?

          Like having moving upwards on the y axis and jumping doing the same just at a different rate while jumping?

          waldron 2 Replies Last reply Reply Quote 0
          • waldron
            waldron F @lawyerlounge last edited by

            @lawyerlounge position my player in the middle of the screen, if i have no gravity the player will sit in that position and i can freely move it around.
            to jump and have the player/sprite come back down apply gravity to that button press???? no idea mate

            lawyerlounge 1 Reply Last reply Reply Quote 0
            • waldron
              waldron F @lawyerlounge last edited by

              @lawyerlounge its not a game breaker i can either have that mechanic or not or just add it later if needs be would be nice to get it working shouldn't be as hard as it seems

              1 Reply Last reply Reply Quote 0
              • lawyerlounge
                lawyerlounge @waldron last edited by

                @waldron yeah so basically have the dpad left/right affect the x coordinate for the sprite and the dpad up/down affect the y coordinate for the sprite. And when you press "A", use a gravity variable that (like the dpad up/down) also affect the y coordinate for the sprite.

                And just like the "Simpson's" style movement with a pseudo 3rd dimension, you will need collisions in certain places. if you go "deeper/up/farther away" towards a wall, you will need to base the collision by the players feet/skateboard and when you go "down/towards the bottom" base the collision from the bottom of the board or wheels.

                Also, if your player is all the way up against a far wall, you should still be able to jump, and in this case the skateboard will need to resist the collision with the wall. I guess anytime your guy is jumping, you can ignore y axis collisions.. though I'm not sure sounds pretty tricky.. but I like thinking these things out loud, since they can help with future problem solving.

                waldron 1 Reply Last reply Reply Quote 2
                • waldron
                  waldron F @lawyerlounge last edited by

                  @lawyerlounge yeah i think its something to be looked into and can apply to many games

                  1 Reply Last reply Reply Quote 0
                  • waldron
                    waldron F last edited by

                    This post is deleted!
                    1 Reply Last reply Reply Quote 0
                    • waldron
                      waldron F last edited by

                      iv got my character loaded as an image not a sprite and stuck with its current size,
                      is there a way of resizing it without cut pasting into a bigger tile size?
                      also can i make a multiple animation sheets for each animation...idle,move,jump ect
                      i can do it with the sprite version of the game i made.
                      would i do it in the same fashion e.g

                      chrsheet = [ loadImage( "Selavi Games/JapaneseSetting", false ),
                      loadImage( "Selavi Games/JapaneseSetting", false )
                      ]

                      pianofire 1 Reply Last reply Reply Quote 0
                      • pianofire
                        pianofire Fuze Team @waldron last edited by

                        @waldron If you are using sprites you an use https://fuzearena.com/help/view/setSpriteScale. If you are using images you can use https://fuzearena.com/help/view/drawImageEx

                        waldron 1 Reply Last reply Reply Quote 1
                        • waldron
                          waldron F @pianofire last edited by

                          @pianofire right so if i
                          drawImageEx( image, location, rotation, scale, tint, origin )
                          scale = 1, 1
                          this would work

                          pianofire 1 Reply Last reply Reply Quote 0
                          • pianofire
                            pianofire Fuze Team @waldron last edited by

                            @waldron That would scale it to the original size. If you want it half size you would use { 0.5, 0.5 } and double size { 2, 2 }

                            waldron 1 Reply Last reply Reply Quote 2
                            • waldron
                              waldron F @pianofire last edited by

                              @pianofire got it, i know i should know this by now still coasting along but i think i got what i need now....

                              pianofire 1 Reply Last reply Reply Quote 1
                              • pianofire
                                pianofire Fuze Team @waldron last edited by

                                @waldron No problem. that's what we're here for

                                waldron 1 Reply Last reply Reply Quote 1
                                • waldron
                                  waldron F @pianofire last edited by

                                  @pianofire cheers, you could do a compendium of my questions for a idiots guide to coding haha
                                  at least others to embarrassed to ask can seek solace in my questions.

                                  Dave 1 Reply Last reply Reply Quote 2
                                  • Dave
                                    Dave Fuze Team @waldron last edited by

                                    @waldron That's exactly why every question should be asked without any embarrassment.

                                    You think your questions are daft? You should hear the list of questions I've asked @Luke throughout my learning journey...

                                    1 Reply Last reply Reply Quote 2
                                    • waldron
                                      waldron F last edited by waldron

                                      so iv managed to resize (scale) my character IMG (whoo hoo) but i'v also added a fore ground tile array so tiles appear over my character to add depth .. but this has also been effected by my scale
                                      for my character as iv had to put the code in after the character to get this effect..
                                      long story short, is there a way for the scale just to be targeted at my character and nothing else???

                                      iv shared my game as (where im at) iv got 3 tile arrays
                                      1 for collision
                                      2 for background
                                      3 for foreground

                                      1 Reply Last reply Reply Quote 0
                                      • Dave
                                        Dave Fuze Team last edited by

                                        @waldron I forget, are you using the sprite functions for your character? Or is it the drawSheet() style of doing things?

                                        Either way, there are separate scale parameters you can apply to anything you like. drawSheet() has an expanded form, drawSheet( imageHandle, { sourceX, sourceY, sourceW, sourceH }, { destinationX, destinationY, destinationW, destinationH } )

                                        That allows you to draw any portion of the original character image, at any scale, to the screen.

                                        The drawImage() function also has an expanded form, drawImage( imageHandle, x, y, scale ). Using these expanded functions, you should be able to set individual scales for anything you need.

                                        waldron 1 Reply Last reply Reply Quote 1
                                        • waldron
                                          waldron F @Dave last edited by waldron

                                          @Dave the draw sheet, so under that iv got
                                          scale = { 1.4, 1.4 }
                                          how do i target it as it effects my 3rd tile array
                                          i can work around it but think it will doom me later on

                                          got ya cheers

                                          1 Reply Last reply Reply Quote 0
                                          • Dave
                                            Dave Fuze Team last edited by

                                            This is why it's generally best practice to use a single scale, consistently throughout your program. It can lead to difficulties if you've got things at different scales. That's hard to plan for though, especially when using entirely your own created graphics.

                                            In the actual draw commands for the things you want to change, you could have a separate scale variable for the player:

                                            playerScale = scale * 1.5
                                            drawSheet( character, { 0, 0, width, height }, { playerX, playerY, width*playerScale, height*playerScale } ) // width and height refer to the pixel width and height of the source image
                                            
                                            M waldron 2 Replies Last reply Reply Quote 1
                                            • First post
                                              Last post