Godot Input Event Example

I want to do a simple board game. Lots of things, I don’t really understand, example the input events. I read the Godot documentation on Input Event but they didn’t provide any project example besides the code.

For beginner, it is not straight forward. So I share the project Input Event example based on the Godot documentation example.

Steps To Do

1. Create Godot Project

2. Create New Input Map

– Click Project -> Project Settings

godot project settings
godot project settings

– Choose Input Map tab

godot - input map
godot – input map

– Find ui_right and choose the right key on your keyboard
– Then click OK
– Do the same with ui_left

3. Test it, by pressing the keys on your game.

– The text will appear on the output screen

godot - output screen
godot – output screen

Add Custom Input Map – Mouse Left Button Click

1. Go to project -> Project Settings

2. Type ui_mouse_left_button_click (you can give any name)

godot - add new input map
godot – add new input map

3. Click Add

4. Add left button event to the Input Map

godot - mouse left button click input map
godot – mouse left button click input map

 

godot - added mouse left button click
godot – added mouse left button click

Godot 3.2.3 Inheritance GDScript Call Parent Function

Lets say you want to have two GDscripts where the ChildScript.gd will call ParentScript.gd.

From there, you want the ChildScript.gd to call its parent function.

Create Class Inheritance

You first create inheritance in GDScript by calling “extends”.

Call Parent Function . Use dot “.” to call parent function

Download Godot Project Example

In this example, when “Press Me” button is clicked. The label will change to “Parent Child” where “Parent” is return value from parent function while child is from child function.

godot-3-2-3 inheritance call parent function
godot-3-2-3 inheritance call parent function

You can download here the project example.

Godot Button Signal Tutorial

I’m still new to games development using Godot engine.

I follow the button signal tutorial on Godot website. I created the project for easy reference for others because at the website they don’t provide the Godot project that you can immediately play.

Full GDScript from the tutorial

Download Godot Button Signal Project

You can download the button signal Godot project here, if you want to run the tutorial.

In case the button signal tutorial is broken link for what soever reasons, I have converted the web page into PDF.

Hope it helps beginner games developer like me.

PHP is not running after upgrade MacOS Big Sur on Apple Macbook Pro M1

Another problem I always face after upgrading MacOS where PHP is not running anymore. I have to google to find solution. Now I decided to write step by step tutorial so easy for my future reference and hopefully can help others who face the same thing.

1) My phpMyAdmin instead of showing login page, it displays its PHP code.

Macos Bigsur upgrade php not running
Macos Bigsur upgrade php not running

2) Uncomment PHP Module

Open httpd.conf

Find php by typing

Remove # to uncomment the PHP module.

remove # from load module php
remove # from load module php

Save the changes by typing

3) Restart Apache

4) Refresh the PHP page

macos big sur php running again after change httpd conf
macos big sur php running again after change httpd conf

Post Office Tesco Mutiara Damansara Business Hours / Operating Hours

I wanted to renew my driving license but couldn’t find easily business hours for Post Office Tesco Mutiara Damansara during MCO.

So I share its business hours / operating hours for everyone convenience.

Every day : 10AM – 6PM
Public Holiday: closed

I went today (21/03/2021) to renew my driving license but to my despair, driving license can only be renewed after 31st March 2021.

Apple Macbook Pro M1 MacOS Big Sur – Missing xcrun after MacOS Update

I always face missing xcrun when I use command “git pull” after MacOS update where the OS will update xcode.

apple macbook pro M1 - missing xcrun
apple macbook pro M1 – missing xcrun

To solve this problem just install back the xcode-select via the command line.

A window will appear whether to continue to install. Just click install.

apple macbook pro M1 - install xcode-select
apple macbook pro M1 – install xcode-select

It takes around 5 minutes to download the file.

apple macbook pro M1 - download xcode select
apple macbook pro M1 – download xcode select

After installation, run again the “git pull” . This time it will work.

apple macbook pro M1 git pull success
apple macbook pro M1 git pull success

Apple Macbook Pro M1 – Auto Change Brightness

Every time I use my Apple Macbook Pro M1 the brightness is automatically changed. It becomes very dimmed when I use the Macbook while on battery power.

Found the solution in Apple forum and put the steps in screenshots for easy for troubleshooting for other Macbooks users.

1) Go to battery preferences

apple macbook pro M1 - battery preference
apple macbook pro M1 – battery preference

2) If your Slightly dim the display while on battery power is checked, please uncheck it.

apple macbook pro M1 - checked slightly dim the display
apple macbook pro M1 – checked slightly dim the display
apple macbook pro M1 uncheck slightly dim the display
apple macbook pro M1 uncheck slightly dim the display

Watching Netflix & Youtube at Genting Permai using Unifi Air

I use Unifi Air as my internet broadband at Genting Permai. Why I use Unifi Air? I chose it because it is affordable and unlimited data. My usage is not that heavy just watching Netflix and Youtube.

Average Download and Upload Speed

If not so many concurrent users, the speed is reasonable. On average download speed is 20MB/s and average upload speed is 2MB/s.

unifi air download and upload speed at genting permai
unifi air download and upload speed at genting permai

No Buffering when Watch Netflix and Youtube

Payment from Nuffnang for My Advertisement Income

I put Nuffnang advertisement on my blog. I requested for pay out for my ads income.

I requested on 25th Nov 2020 and received the check on 16th January 2021. It took nearly 2 months to get the check.

Based on my experience with Nuffnang, its income not as good as before and better use Google AdSense. My blog rarely shows any Nuffnang advertisement maybe due to low traffic. Ha ha

nuffnang letter containing check
nuffnang letter containing check
nuffnang check from nuffnang
nuffnang check from nuffnang
nuffnang check received
nuffnang check received

Stream Movies from Ubuntu Shared Folder to Samsung Smart TV

Set Up Sharing Folder Service at Ubuntu

Install minidlna service

Configure /etc/minidlna.conf (sets WHICH FOLDERS to use AND who is using the service)

edit /etc/minidlna.conf :

Notes: for vim, press insert to edit the file, then press escape “:x” to save changes.

Configure the path & friendly name

minidlna conf - media path
minidlna conf – media path

minidlna conf - friendly name
minidlna conf – friendly name

Configure user:

minidlna - conf - user root
minidlna – conf – user root

Save the changes

Configure /etc/default/minidlna (sets WHO the service runs as)

Configure user as root

minidlna - conf - user root
minidlna – conf – user root

Save the changes

Restart minidlna service

Access the Folder at Samsung Smart TV

Go to input source, you will see friendly name that has been set.

samsung smart tv - source view ubuntu nas
samsung smart tv – source view ubuntu nas
samsung smart tv - folders inside the ubuntu nas
samsung smart tv – folders inside the ubuntu nas

Video on Accessing the Ubuntu NAS

References:

http://mylinuxtechcorner.blogspot.com/2013/09/smart-tv-streaming-from-ubuntu-nas.html
Running minidlna on Ubuntu