Wednesday, April 29, 2020

Discord on Linux Mint Debian Edition (LMDE 4)

What is discord? As the website says:
Discord is the easiest way to communicate over voice,video, and text, wether you're part of a school club, a nightly gaming group, a worldwide art community, or just a handful of friends that want to hang out.

To install Discord on Linux Mint Debian Edition a.k.a LMDE 4 Debbie, open the Software Manager apps, go to search, insert the keyword Discord and click install button. And thats it.. ...wait what?

Please take a look at the list of change below. 722.2 MB will be downloaded in total. 2.5 GB more disk space will be used.  O_o"

Unfortunately, Discord only available from flatpak packages and not in the repositories as apt-cache policy returns nothing.

So the Software Manager wants to install Flatpak first before it can install other packages.

Maybe, Flatpak has some benefical as it said it allow the packages to be distro independent and more secure than installing unofficial packages. But hey, i will choose unofficial path for now :)

And yes, the Discord websites provide "unofficial" packages to be downloaded.

Save it to the hard disk.



2.2 MB will be downloaded in total. 179.1 MB more disk space will be used.

Install it and enjoy more free GB's for another use :D

Friday, January 24, 2020

GameMaker Studio 2 - Build-In Functions

4. BUILD-IN FUNCTIONS

Last post we have learn how to draw a rectangle using draw_rectangle () function. This function is a build-in functions that available within the GameMaker Studio 2 Language (GML). For all the list of available functions along with the required arguments and examples of code to show how thy can be used, we can look it at the documentations from yoyogames here.

Aside from the web documentations, middle click at the function within the editor will open a documentation tab to find some brief explanations and examples.








Now lets "move-along" with the lesson from sheepolution.com. 😀

Just like the post before, we start by drawing another rectangle in the draw event :

//Draw a rectangle
draw_rectangle(100,50,200,150,true);


When we look at the documentations, the numbers are x and y position of the left corner rectangle against the GameMaker room, as of (0,0) is located at the top left of the screen or at the top left of the GameMaker room.










draw_rectangle(100,50,200,150,true);

100 = The x coordinate of the top left corner of the rectangle.
50   = The y coordinate of the top left corner of the rectangle.
200 = The x coordinate of the bottom right corner of the rectangle.
150 = The y coordinate of the bottom right corner of the rectangle.
true = Whether the rectangle is drawn filled (false) or as a one pixel wide outline (true).




















And now, how to make the rectangle move? 
When the rectangle move, means the coordinates is being altered either by adding some amount of value or by subtract some amount of value.

In LÖVE framework (as written at sheepolution.com tutorials), we do this by using code :

function love.load() x = 100 end
function love.update() x = x + 5 end
function love.draw() love.graphics.rectangle("line", x, 50, 200, 150) end


Lets add a Create event :
x = 100;

And add a Step event :
x = x + 1;













And modified the draw event :
draw_rectangle(x,50,200,150,true);


and things become very weird :
Why is that?

Lets take a look at the function that we write in the draw event :

draw_rectangle(x1,y1,x2,y2,true);
draw_rectangle(x,50,200,150,true);

We only alter the value of x1 but not x2, thats why. The x1 is moving along 1 pixel at a time at x axis, but the x2 is not moving because the value is fix at (200,150) coordinates.

Now lets fix the code :

draw_rectangle(x,50,x+100,150,true);

why is x+100, not x+200 ?
Well, we have create a variable in the Create event :

x = 100

so x+100 equal to 100+100 = 200.

If we run the game now, the rectangle now should move normally.

GameMaker Studio 2 - LÖVE

3. LÖVE

LÖVE is a framework, a tool that makes programming games easier.
.....wait, what ? 😁

I was browsing through some game engines that run on linux and i found this sheepolution.com, a beautiful web contain tutorials for LÖVE game engine. Its written there, that LÖVE calls 3 functions :




- love.load()
- love.update()
- love.draw()

To draw a rectangle using LÖVE, we do the following :

function love.draw() love.graphics.rectangle("fill", 100, 200, 50, 80) end

What about GMS2 ?
Lets create a GameMaker Language Project, double click on the room0 and set it to 640 width and 480 height in room properties.











Lets create an object by pressing Alt + O.  An Object Window will appear alongside with event window.

There are lots of event listed there, but as far as i know, following LÖVE main functions, the three main event is create event, step event, and draw event.

To draw a rectangle using GMS 2, we do the following :

Add a draw --> draw event. Another window will pop up where we can write our code.
We add functions :

//Draw a rectangle
draw_rectangle(100,200,50,80,false);

Now, go to room tab, and drag the object from the right panel into room0.











Run the game by pressing F5, and voila, there's the rectangle 😊

Thursday, January 23, 2020

GameMaker Studio 2 - Variables and Functions

2. VARIABLES AND FUNCTIONS

Lets take a look from GMS2 documentations :

Just like any other programming language, GML uses variables as the basic unit for most programming operations.

A variable is something that we use to store a value for use in one or more operations o functions.

Lets do some math.
1 + 2 = 3.

okay, now lets add
a + b = ..... ?

it is hard to answer.
how about
a = 1
b = 2
a + b = 3

A variable could be anything. lets take another look from the documentations, the example of variables :

potions = 12;
life = 100;
name = "Jock MacSweeney";
strength = 5.5
armour = -2;

Now, In many programming languages you need to "declare" a variable before you can use it. This basically means that you tell the computer the name you wish to use so that it can assign a place in memory to store whatever value you decide to hold in that variable. With GML, that is not always necessary as it depends on the scope of the variable.

Now, what about functions?

A function is a block of organized, reusable code that is used to perform a single, related action. Functions provide better modularity for your application and a high degree of code reusing.

As in GameMaker Studio 2, GameMaker language gives you many built-in functions like move_towards_point( x, y, sp );, etc. but you can also create your own functions. These functions in GameMaker Studio 2 are called scripts.

Again, lets take a look at the documentations :

A function has an input and an output, and the output is related somehow to the input.
In GameMaker Studio 2 you use functions as part of the code structure to make things happen in your game and there are a great number of GML functions available to you, all of which are explained in the Language Reference section of the manual.

In GML a function has the form of a function name, followed by the input arguments between brackets and separated by commas (if the function has no input arguments then just brackets are used). Here is an outline of the structure of a function:

<function>(<arg0>, <arg1> ,... <arg15>);

As for the example above, the <function> is move_towards_point and the <args> are x, y and sp;



Learn How To Program With GameMaker Studio 2

It is a beautiful title isn't it? 😁

INTRODUCTION

Long time absence from game development world (as a hobbyist) make me forget how to create even just a simple games that i stumbled upon my old post of this platformer gif picture and wondering, did i made those movement engine?

The need to redo tutorials that i might find on the internet to refresh the knowledge of how to program is coming on urge to my brain. and this time i think i will "share" the journey in my blog to keep me remembering those tutorials. The list will be "growing" over time, and might stop anytime depend on the availability of my spare time.

Of course this walk together of learn to program will be using GameMaker Studio 2, a game engine to create 2D games that said is beginner friendly enough for a newbie. This engine is something that i wish had a linux ide for long time. Wish is a wish, and business has to carry on 😁

DISCLAIMER
I am not a programmer evangelist nor a game development specialist. Just common hobbyist who love to write a blog. There will always be a better way or other way to do things and achieving the same result rather than using content from this blog. One way or another, here is the planned list of contents. 😉

TABLE OF CONTENTS

2. Variables and Functions
3. GameMaker Studio 2 - LÖVE
4. To be added soon.. 

Wednesday, January 22, 2020

Colour Code

Colour Code :


Insync

So what is this Insync thing?
Insync is the official unofficial Google Drive client for PC.
Just like the picture said, insync manage your Google Drive files straight from your desktop.

But, Dropbox?
Because Dropbox start to limit the number of devices that can link to a basic users account up to only three devices.
Because Dropbox is limiting the synchronization support to only Ext4 for linux. Meanings that if you have a dualboot OS Windows and Linux, Dropbox no longer can shared the folder under the same NTFS-shared HDD. Upgrading to a premium users don't change this support.

...errr, OneDrive?
OneDrive is nice, but it doesn't have a GUI linux client -yet. There is a workaround over the net, but a dedicated GUI for linux is nice.
On Windows side, OneDrive doesn't have a separated proxy-setting -yet. It follow the global Windows proxy system setting.

Google Drive?
My personal experience with official Google Drive Client -that only available for windows-, the client would freeze every now and then at system shutdown. The client also had a hard time for merging a folder, resulting many duplicate files with index behind the filename. 

filetxt.txt
filetxt(1).txt
filebitmap.bmp
filebitmap(1).bmp
...and so on.

Google Drive also don't have a client for linux system yet. So, i have a love-hate relationship with Google Drive :).

Insync + Google Drive?
Insync adds Google Drive functionality to the Windows, Linux and mac OS desktop. Sync, backup, edit and share files easily with one or multiple accounts.

Insync has its own proxy setting. Its a good thing to have if you deal a lot of local application through LAN but using a proxy to connect into the internet.

- edited-
Insync has added OneDrive support too as from their blog here:
https://www.insynchq.com/blog/insync-3/


tl,dr :
Very happy to use Insync as my main cloud-based storage client for now 😊