Sunday, November 22, 2020

Python #001 - keywords, classes and instances

 

 

I wanna to get to the Google Drive API and JIRA and connect them together. In order to do that I've tried to prepare code in C#. I managed to do that... but if I want to deploy it online I need a server and more skill to that. I decided to switch to Python - there are people who will help me to deploy this kind of app.


So what is Python?

Python is an interpreted, high-level and general-purpose programming language. Python's design philosophy emphasizes code readability with its notable use of significant whitespace. Its language constructs and object-oriented approach aim to help programmers write clear, logical code for small and large-scale project.

Where to start?

I started with classes and instances. A great read over here: https://docs.python.org/3/tutorial/classes.html

There is "a little bit" different syntax than in JAVA (not so complex). This is my first class

The best example to explain how to use class variable shared by all instances and instance variable unique to each instance:

What about the keywords?

Keywords are special words which are reserved and have a specific meaning. Python has a set of keywords that cannot be used as variables in programs.

All keywords in Python are case sensitive.

Python Keywords Display Using Python Shell 

A quick shortcut to print the list of all the keywords:


 

Sunday, October 25, 2020

Unity #002 - PlayerController script (probably part #01)

There are many methods of coding a player movement. I wrote down two of them (the most convenient ones for my solution). Reminder here - I've been learning Unity for a short period of time so probably there are plenty better methods to do the PlayerController script for this solution :)

The first method is using Unity function AddForce

 

 to a myRigidbody I've added force by Vector2. It will move acc. to forceFactor value

A second method it is function MovePosition


Here there is no physics (no forces) added. I just added vector value to the current position.

Friday, October 23, 2020

Unity #001 - First blood

 All right I am back to blogging. This time it is a time for Unity and C#. I've done a 12 hour course with a fine teacher. Now I am trying to focus on game creation from the scratch and learn as much as possible.


The first game I will try to do is "Zeldish" style of game. I will build a simple player controler and few levels. I've already downloaded free assets for this one.

It will look like this: 


More to come. Let's go!