Coding With Russ
Coding With Russ
  • Видео 194
  • Просмотров 5 114 664
How To Rotate Tiles with Code in Godot
In this video I will explain how to rotate tilemap tiles in Godot using code.
The editor has buttons that allow you to rotate and mirror tiles when creating a tilemap, but this is more difficult when you need to modify your tilemap in the game at run time.
This video gives the code that I used to achieve this in my automation game.
Просмотров: 383

Видео

7 Days of Game Dev - Adding New Machines, Fixing Bugs and More! - Devlog #3
Просмотров 1,3 тыс.Месяц назад
Welcome to the third episode of my automation game devlog series! In this video I add five new machines - a furnace, combiner, a market, a splitter and a merger. I also fix a few annoying bugs and upgrade my input and output system.
Adding Resources To My Game: Automation Game Devlog #2
Просмотров 1,6 тыс.Месяц назад
Welcome to the second episode of my automation game devlog series! In this video, I dive a bit deeper into the logistic network add my first two machines - an extractor and a compactor, setup the random world generation and create three starting resources: cows, chickens and wheat.
Adding Conveyor Belts to My New Game! | Devlog
Просмотров 2,9 тыс.2 месяца назад
Devlog video about my automation / factory game I'm creating using Godot 4. In this first part, I am working on getting the basic concept of the game defined and focusing on the main component which is the conveyor belts for moving items around the factory.
Top Down Survival Shooter In Godot | Part 9 - Completed Waves
Просмотров 3,3 тыс.4 месяца назад
Learn how to make a game from scratch in Godot. This survival shooter will be a top down game with 8 directional movement. Endless waves of enemies attack the player with each wave getting more and more difficult. In this part, I will complete the game by adding a way of checking if the wave is finished, increasing difficulty and starting the next wave to have an endless survival game. Code and...
Top Down Survival Shooter In Godot | Part 8 - Game Over
Просмотров 1,3 тыс.4 месяца назад
Learn how to make a game from scratch in Godot. This survival shooter will be a top down game with 8 directional movement. Endless waves of enemies attack the player with each wave getting more and more difficult. In this part, I will add a game over screen with a restart button to allow the game to begin again when the player runs out of lives. Code and assets for this video: github.com/russs1...
Top Down Survival Shooter In Godot | Part 7 - Item Drops
Просмотров 1,8 тыс.4 месяца назад
Learn how to make a game from scratch in Godot. This survival shooter will be a top down game with 8 directional movement. Endless waves of enemies attack the player with each wave getting more and more difficult. In this part, I will add power up items that are dropped by the enemies. When picked up by the player, these will give various short boosts. Code and assets for this video: github.com...
Top Down Survival Shooter In Godot | Part 6 - HUD
Просмотров 1,4 тыс.4 месяца назад
Learn how to make a game from scratch in Godot. This survival shooter will be a top down game with 8 directional movement. Endless waves of enemies attack the player with each wave getting more and more difficult. In this part, I will create a heads up display (HUD) to show useful game info like the number of lives, current wave and the number of enemies on this wave. Code and assets for this v...
Top Down Survival Shooter In Godot | Part 5 - Shooting
Просмотров 3,4 тыс.4 месяца назад
Learn how to make a game from scratch in Godot. This survival shooter will be a top down game with 8 directional movement. Endless waves of enemies attack the player with each wave getting more and more difficult. In this part, I will add bullets that the player can shoot when the mouse is clicked. Code and assets for this video: github.com/russs123/Prairie_King_Tut Credits for images Character...
Top Down Survival Shooter In Godot | Part 4 - Enemy AI
Просмотров 3 тыс.4 месяца назад
Learn how to make a game from scratch in Godot. This survival shooter will be a top down game with 8 directional movement. Endless waves of enemies attack the player with each wave getting more and more difficult. In this part, I will add some AI to the enemies to make them follow and attack the player. Code and assets for this video: github.com/russs123/Prairie_King_Tut Credits for images Char...
Top Down Survival Shooter In Godot | Part 3 - Enemy Spawner
Просмотров 3,7 тыс.4 месяца назад
Learn how to make a game from scratch in Godot. This survival shooter will be a top down game with 8 directional movement. Endless waves of enemies attack the player with each wave getting more and more difficult. In this part, I focus on creating a spawner to automatically generate enemies at 12 random points on the game map. Code and assets for this video: github.com/russs123/Prairie_King_Tut...
Top Down Survival Shooter In Godot | Part 2 - Player Movement
Просмотров 4,1 тыс.4 месяца назад
Learn how to make a game from scratch in Godot. This survival shooter will be a top down game with 8 directional movement. Endless waves of enemies attack the player with each wave getting more and more difficult. In this part, I focus on creating the player and adding 8 directional movement. Explanation of 8 directional movement by kidscancode here: kidscancode.org/godot_recipes/4.x/2d/8_direc...
Top Down Survival Shooter In Godot | Part 1 - Tilemap Tutorial
Просмотров 10 тыс.4 месяца назад
Learn how to make a game from scratch in Godot. This survival shooter will be a top down game with 8 directional movement. Endless waves of enemies attack the player with each wave getting more and more difficult. In this part, I focus on setting up the project and making a game map using tilemap and tile sets. Code and assets for this video: github.com/russs123/Prairie_King_Tut Credits for ima...
How to Make Pool (Billiards) Using Godot's Physics Engine | Godot Tutorial
Просмотров 6 тыс.5 месяцев назад
Learn how to work with physics objects in Godot by creating a pool game. The game will use three of the four godot 2D collision objects - Area2D, StaticBody2D and RigidBody2D. I will customise the physics properties of the objects but won't code any physics in the script, this will all be done by godot's physics engine. Code and assets for this video: github.com/russs123/Pool_tut Credits for im...
Beginner Godot Tutorial - How to Make Pong with AI
Просмотров 17 тыс.6 месяцев назад
Learn the basics of Godot by making a pong game from scratch. This tutorial will use static collision shapes, area2d as well as character body 2d nodes to handle the different collision types. The played paddle is controlled with up and down keys while the enemy paddle has AI control which follows the position of the ball. Code and assets for this video: github.com/russs123/Pong_tut Font: www.f...
Beginner Godot Tutorial - How to Make Tetris
Просмотров 10 тыс.6 месяцев назад
Beginner Godot Tutorial - How to Make Tetris
How to Make a Google Chrome T-Rex Style Sidescroller In Godot | Beginner Tutorial
Просмотров 28 тыс.6 месяцев назад
How to Make a Google Chrome T-Rex Style Sidescroller In Godot | Beginner Tutorial
How to Make Minesweeper In Godot | Beginner Tutorial
Просмотров 4,7 тыс.7 месяцев назад
How to Make Minesweeper In Godot | Beginner Tutorial
Beginner Godot Tutorial - Make Flappy Bird in 12 Minutes!
Просмотров 26 тыс.7 месяцев назад
Beginner Godot Tutorial - Make Flappy Bird in 12 Minutes!
Beginner Godot Tutorial - Make a Snake Game in 10 Minutes!
Просмотров 17 тыс.7 месяцев назад
Beginner Godot Tutorial - Make a Snake Game in 10 Minutes!
Beginner Godot Tutorial - How To Make Tic Tac Toe
Просмотров 10 тыс.8 месяцев назад
Beginner Godot Tutorial - How To Make Tic Tac Toe
How to Fix The "Module Not Found" Error for Pygame in Under 2 Minutes! [2023]
Просмотров 67 тыс.9 месяцев назад
How to Fix The "Module Not Found" Error for Pygame in Under 2 Minutes! [2023]
I Made 3D MINECRAFT in PYTHON using Ursina!
Просмотров 27 тыс.9 месяцев назад
I Made 3D MINECRAFT in PYTHON using Ursina!
Complete Tower Defence Tutorial in Pygame From Scratch
Просмотров 15 тыс.10 месяцев назад
Complete Tower Defence Tutorial in Pygame From Scratch
Tower Defence Tutorial in Pygame | Part 13 - Finishing Touches
Просмотров 2 тыс.10 месяцев назад
Tower Defence Tutorial in Pygame | Part 13 - Finishing Touches
Tower Defence Tutorial in Pygame | Part 12 - Game Over Handling
Просмотров 1,1 тыс.10 месяцев назад
Tower Defence Tutorial in Pygame | Part 12 - Game Over Handling
Tower Defence Tutorial in Pygame | Part 11 - Game Mechanics
Просмотров 1,2 тыс.10 месяцев назад
Tower Defence Tutorial in Pygame | Part 11 - Game Mechanics
Tower Defence Tutorial in Pygame | Part 10 - Automatically Spawn Enemies
Просмотров 1,7 тыс.10 месяцев назад
Tower Defence Tutorial in Pygame | Part 10 - Automatically Spawn Enemies
Tower Defence Tutorial in Pygame | Part 9 - Upgrading Turrets
Просмотров 1,3 тыс.10 месяцев назад
Tower Defence Tutorial in Pygame | Part 9 - Upgrading Turrets
Tower Defence Tutorial in Pygame | Part 8 - Aiming and Firing
Просмотров 1,7 тыс.10 месяцев назад
Tower Defence Tutorial in Pygame | Part 8 - Aiming and Firing

Комментарии

  • @ScienceIsMine
    @ScienceIsMine 4 часа назад

    Great tutorial!

  • @dovos8572
    @dovos8572 12 часов назад

    at 17:30 you are using 2 for loops to iterate over the tilemap to search for the mines. why aren't you just using the mines array that you created before in the mines layer? that would mean you only need one for loop and a simple check if it is at the border. then just add +1 around the mine cell. after each mine cell is looped through the surrounding cells should be set correctly. to do the +1 you just need to add +1 to the atlas x coordinate. this should simplify that part of the code quite a bit. also i don't know if you change that later in the video, so this comment might not be as relevant. now at 25:50 i'm really confused what you are doing. it seems that you are doing the inverse of what i thought should be done with the first part of my comment. why are you searching the 8 cells around an empty cell and hope that a bomb is in it? using that exact function on the bomb would give you all cells that need to increment it's shown number. you don't need to go through all empty cells of the tilemap and count the surrounding bombs that COULD be there.

    • @dovos8572
      @dovos8572 8 часов назад

      for those interested, this is what i thought it would be. @export var Columns : int = 16 @export var Rows : int = 16 @export var MineCount : int = 10 @export var Mine_positions : Array[Vector2i] enum Layers {Background, Mines, Numbers, Gras, Pointer} func create_mines(): var mine_texture = Vector2i(5,1) for i in range(MineCount): var mine_pos : Vector2i = Vector2i(randi_range(0, Columns-1), randi_range(0, Rows-1)) while Mine_positions.has(mine_pos): mine_pos = Vector2i(randi_range(0, Columns-1), randi_range(0, Rows-1)) Mine_positions.append(mine_pos) set_cell(Layers.Mines, mine_pos, 0, mine_texture) func create_numbers(): var target_cell : Vector2i for mine_pos in Mine_positions: for x in range(3): for y in range(3): target_cell = mine_pos + Vector2i(x - 1, y - 1) if target_cell != mine_pos and !Mine_positions.has(target_cell) : if (target_cell.x >= 0 and target_cell.x <= Columns-1 and target_cell.y >= 0 and target_cell.y <= Rows-1): var target_cell_atlas = get_cell_atlas_coords(Layers.Numbers, target_cell) if target_cell_atlas != Vector2i(-1,-1): target_cell_atlas.x += 1 # moves one to the right in the atlas. set_cell(Layers.Numbers,target_cell,0,target_cell_atlas) else: target_cell_atlas = Vector2i(0,0) # my numbers are in the first row. in the video they are in the second row set_cell(Layers.Numbers,target_cell,0,target_cell_atlas) func create_gras(): # creates a chess board pattern for x in range(Columns): for y in range(Rows): if x % 2 == 0: if y % 2 == 0: set_cell(Layers.Gras, Vector2i(x,y),0,Vector2i(0,1)) else: set_cell(Layers.Gras, Vector2i(x,y),0,Vector2i(1,1)) else: if y % 2 == 0: set_cell(Layers.Gras, Vector2i(x,y),0,Vector2i(1,1)) else: set_cell(Layers.Gras, Vector2i(x,y),0,Vector2i(0,1)) this is the code that is needed to create the 3 layers by code. no additional helper functions or multiple looping over the entire field.

  • @alperklc7782
    @alperklc7782 14 часов назад

    thanks

  • @diptiyadav1861
    @diptiyadav1861 17 часов назад

    sir which level editer you use❤

  • @Mlowe89
    @Mlowe89 19 часов назад

    Is it possible to set up a tkinter gui text based adventure game but integrate this style of turn based combat with pygame into the same game?

  • @zeratul11000
    @zeratul11000 22 часа назад

    i want your Tiled tutorial!! your explanation is so detailed it helps me to understand a lot!! i watched and practiced some pygame tutorials, your lecture is the most detailed and understandable!😁😁

  • @fabriciomiranda5773
    @fabriciomiranda5773 День назад

    Thank you for doing this video! I had work 2 years with python but I never had to install it, the company computer came with it. You are awesome!

  • @the_flying_airplane5335
    @the_flying_airplane5335 День назад

    This was an amazing tutorial! One question, when I run the code it’s very inconsistent- sometimes it moves quickly and other times it moves very slowly. I’m running it on a rather old laptop so I wonder if that’s the issue. Anything I can do to fix it?

  • @tahaselimcagman1305
    @tahaselimcagman1305 День назад

    hi russ , i added all the level_data files in my folder but when i run it i can't see the whole screen . do i need to do an operation with level_editor.py

    • @CodingWithRuss
      @CodingWithRuss 21 час назад

      The window might just be too big for your screen. You can change the screen width and height variables to make it fit. But when you do that also make sure to reduce tile_size accordingly.

  • @gandhibarra3036
    @gandhibarra3036 День назад

    8:45, a note for myself

  • @feilox
    @feilox 2 дня назад

    nice so i should stick to unreal and unity then lol.

  • @RSTGames-ggboys
    @RSTGames-ggboys 2 дня назад

    You're the best!

  • @Sunrit_Mullick
    @Sunrit_Mullick 2 дня назад

    I followed the whole tutorial, made the game, learnt a lot. Thank you so much. I am now thinking to add music like bg music or play some music while clicking, or game over music. Small changes but it'll make the experience a lot better I think. Thanks again.

    • @CodingWithRuss
      @CodingWithRuss 21 час назад

      Nice! It's definitely a good idea to add your own features to these games to expand your own knowledge and experience of with pygame

  • @kioshy117
    @kioshy117 2 дня назад

    thank you i needed this so bad

  • @mikeyslusher5322
    @mikeyslusher5322 3 дня назад

    so im having abit of a issue with my paddle stopping when i start the project it wont move down i can move up and then back down but it stops at the starting point

  • @bradley1048
    @bradley1048 3 дня назад

    This is great! But I've attached my shooting script to a seperate gun that rotates around the player. When I fire my bullet, it doesn't actually spawn from my gun and move around like in 6:30. It spawns at a specific point in the world and doesn't move with me. Edit: Instead, I attached the script to my player and created a marker at the end of my gun. I set the transform of the bullet to be the position of the bullet marker like this: bullet.transform = get_node("../Player/Gun/BulletMarker").global_transform Then in my bullet scripts I changed it to: func _physics_process(delta): position += transform.x * speed * delta Now the bullet spawns at the marker and shoots out in the direction I am aiming. The only problem is, my collision aren't working. The bullets don't seem to collide with anything.

  • @rezashir3873
    @rezashir3873 4 дня назад

    Well done

  • @toall_stone740
    @toall_stone740 4 дня назад

    Thank you.

  • @mikeitkulof
    @mikeitkulof 4 дня назад

    Thank you very much. The video was very informative and clear. I modified my code a little bit between videos to also check if multiplication of all cells == 0, thus checking if there's still a still a place to land a mark.

  • @RellyBautista-np4pj
    @RellyBautista-np4pj 4 дня назад

    Im javascript game developer but im watching your video coz theres arrent so many tutorial about javascript game development.

  • @MultiYougay
    @MultiYougay 4 дня назад

    Thx man. It was my interpreter ^^

  • @scorpi0uk
    @scorpi0uk 4 дня назад

    Great video and good to know these possible nuances but is it not possible to just rotate the tile "normally" by 90, 180, 270 degrees? (Probably using the deg_to_rad method) and then having rhat data saved so its remembered? Maybe theres some other logic im missing like the sprite being rotated but not the direction that items move? Just spitballing here

    • @CodingWithRuss
      @CodingWithRuss 4 дня назад

      I expected there would be a way to rotate the tiles like you described but I couldn't find anything in godot that would do that. An individual sprite2D could be rotated easily enough but that didn't seem to be the case for a tilemap tile since there just isn't a method for rotating tiles with code. Hopefully it is something that gets simplified in future versions of godot.

  • @Luke-gw6sk
    @Luke-gw6sk 5 дней назад

    is there a link to download the level editor somewhere?

  • @gfgdfgd39
    @gfgdfgd39 5 дней назад

    How do I check for collision within it's own sprite group? So one sprite in group A and another sprite also in the same group.

  • @tf5pZ9H5vcAdBp
    @tf5pZ9H5vcAdBp 5 дней назад

    Weird way to figure out I'm a mother, getting a mother's day gift from coding with Russ.

  • @ToastyLeVrai
    @ToastyLeVrai 5 дней назад

    Not working …

  • @woodenfences
    @woodenfences 5 дней назад

    Well done the coding logic, and well done the video about it. Thanks for sharing!

  • @user-zx3mk3wl6e
    @user-zx3mk3wl6e 5 дней назад

    Good job ❤ More godot content please

  • @puzzodimeme1909
    @puzzodimeme1909 5 дней назад

    Nice tutorial but I have only one problem,the player paddle doesn't hit the ball. The CPU hits the ball but the player not Can someone help me?

    • @CodingWithRuss
      @CodingWithRuss 4 дня назад

      It may be something to do with your collision shape nodes. Double check that you have attached a collision shape to the player paddle too. You can also turn on the option to view collision shapes from the "Debug" menu at the top of the editor. This will show you the collision shapes in game so you can see if anything is wrong

    • @puzzodimeme1909
      @puzzodimeme1909 4 дня назад

      Thank you very much, this was my second project in godot

  • @ARTHURTHEBG
    @ARTHURTHEBG 5 дней назад

    do you know a way to convert all of the blocks into chunks? so it reduce the lag?

  • @alexany4619
    @alexany4619 5 дней назад

    Hi - which version of Pygame are you using?

  • @MaximeVerstraeten
    @MaximeVerstraeten 5 дней назад

    How would you make the AI less precise? (i.e. how do you stop it from making perfect shots every time?)

  • @user-ch2cw9jj8h
    @user-ch2cw9jj8h 5 дней назад

    Thanks! I love you

  • @Swagster1000-sy3ng
    @Swagster1000-sy3ng 6 дней назад

    These tutorials are really good. I do have one issue though. In this game and the dino run, when I plug the same data, the game movement speed is way faster. Example, I had the same numbers, and the pipes moved at blistering speeds.

  • @bouncepen932
    @bouncepen932 6 дней назад

    very cool. excellent job and presentation.

  • @abdullahajeebi
    @abdullahajeebi 6 дней назад

    1:28 How did you do that?

  • @ftmah5941
    @ftmah5941 6 дней назад

    the real GOAT. Super short code yet functions like crazy. Thumbs up to you man

  • @oliverandamms738
    @oliverandamms738 7 дней назад

    I did everything the same but the rectangles wouldn't move, this was my fix if you need it: if key_state[pygame.K_LEFT]: player.x -= 1 elif key_state[pygame.K_RIGHT]: player.x += 1 elif key_state[pygame.K_UP]: player.y -= 1 elif key_state[pygame.K_DOWN]: player.y += 1

  • @adriano.santana
    @adriano.santana 8 дней назад

    It's because of people like you that the Godot community continues to grow. Thanks for this tutorial series, very easy to understand.

  • @glode1726
    @glode1726 8 дней назад

    yo russ do you know how can i make collision with a scrolling background?

  • @PpPp-tl5li
    @PpPp-tl5li 8 дней назад

    I want you to be my coding teacher pls give my your number

  • @mohamedkamel6449
    @mohamedkamel6449 8 дней назад

    Thank you , solved my problem

  • @qingxian3870
    @qingxian3870 8 дней назад

    nice video your code is readable and clear,thank

  • @romola7
    @romola7 8 дней назад

    I'm just starting with python and your video is truly inspiring, keep up the great work!

    • @CodingWithRuss
      @CodingWithRuss 8 дней назад

      Thanks! And good luck with your python journey

  • @glode1726
    @glode1726 9 дней назад

    for some reason the x collision doesnt work

  • @OmongosCharlie
    @OmongosCharlie 9 дней назад

    Ma dude you are an angel that helped me in my dark hour <3

  • @gamalielgerona2391
    @gamalielgerona2391 9 дней назад

    Where did you get all those textures?

  • @djmadfabe
    @djmadfabe 9 дней назад

    Great video. Now I can use all the things I just learned from this short video on my project. Thank you very much

  • @justcallmespike5162
    @justcallmespike5162 9 дней назад

    I am attempting to code the rectangle movement, but I can only press one directional button each time I run it, and then it goes to the edge of the screen and doesn't move if I try to press another one.

  • @kevonthomas6130
    @kevonthomas6130 9 дней назад

    Thank you alottt 💯💯💯💯