Powered by Invision Power Board

 
  Pages: (87) « First ... 8 9 [10] 11 12 ... Last » ( Go to first unread post ) Reply to this topicStart new topicStart Poll

> MechaSource - Beta SDK Discussion, Develop, share and play games
United States
OniLink10
Posted: Aug 30 2008, 05:50 PM
Quote Post


C++ Programmer, Unofficial Physicist, and Unofficial Chemist
[*][*]

Group Icon
Group: Members
Posts: 3920
Member No.: 4907
Joined: 19-February 08

Status: (0d) [--]


QUOTE (Mr. Bird @ Aug 30 2008, 03:29 PM)
SO what exactly is this? Like a game maker sort of program?

Yes. I think they're trying to make it even easier than Game Maker, and even more Bug-Free.


--------------------
QUOTE (Xgoff @ Sep 10 2009 @ 06:11 PM)
did you try hello's engine

make sure to not ****ing change anything before using it!
PMEmail PosterUsers WebsiteYahoo
Top
Denmark
Mecha the Slag
Posted: Aug 30 2008, 08:34 PM
Quote Post


http://mechaware.net
[*][*][*][*][*]
[*][*][*]

Group Icon
Group: Members
Posts: 11816
Member No.: 728
Joined: 15-December 04

Status: (0d) [--]


UPDATE 3
MAKING YOUR FIRST PLATFORMER (PART 1)


Functions used in this update
CODE
require(lua file)
makeSpirit()
makeBodyRectangle(offset_x,offset_y,size_x,size_y)
makeImage()
setMother(mothertype, mother)
setImage(imagepath)
setCenter(x,y)


Description
Teaches you how to use the script editor and make a player that you can control.

Main
The main focus on MechaSource is not only to play others games, but also make your own! I this update we'll teach you how you start your development and end up with a nice platformer!
First, we have to start the development of it. This is done by entering your Developer Section.
user posted image
A popup will ask you alot of information about your upcoming game such as name, developers, website, genre etc.. All of those information can be changed at any time, however, once your game has been released it's name cannot be changed.
Anyways we'll call our new game for "Platformer Game". It should appear in "Your Games" in the Developer Section.
user posted image
You'll see that it's icon is currently a questionmark. We want to change this.
For this demonstration I'll be using this image for my game icon:
user posted image
To do this we go to the "Game Icons" tab in our Developer Section, and change the icon. The image has to be a .png and of size 96x96 pixels.
user posted image
The icon has nothing to do with the ingame things, but it shows up in the owners Game section instead of a standard questionmark, so changing it is a must for a professional game.

Now we want to actually script our game. This we do by using yet another tab called "Manage Your Game". Click it.
user posted image

which will lead you to the Script Editor!
user posted image
This is where we will be spending most of our time. Basically it's just like notepad or any other text editors but it highlights stuff so they're easier to use.
Note: You can edit the files manually in your Develop folder, however, this Script Editor provides an easier interface.

Now, before we start any scripting, we'll just launch our thing here for a second to see what it actually contains at default. You run your game by double-clicking it in the Developer Section.

user posted image
As you can see, it already contains alot of stuff by default such as a platformer engine. However, we want to remake that, so we'll just empty the "physics" folder inside your Develop\game folder.
Now, return to your Script editor. You'll notice as soon as the script editor opens, it'll open up main.lua. Main.lua is the file that gets executed in the begging of your game. You'll see how it uses the require() function to load the "physics/player" lua file at line 16. Remove that line and save.
We also have to remove one of the always loops that are used in the default script. Open up "always.txt" in your Develop game root and remove "playermovementupdate()".

Lets start the actual making of our platformer.
First we'll make a script. Doubleclick somewhere above the script box and a new file should appear. Save it as "player.lua".

Here we'll have to create the player Spirit. A Spirit is what controls the player, his velocity, his positions etc.. We do this using the code
CODE
makeSpirit()

Note that case does matter at all times in MechaSource.
This creates a spirit, however, we need to use this spirit for later, so we'll have to name it first. We do this by adding
CODE
player = makeSpirit()

This tells lua that the variable called "player" is the name of makeSpirit().

Next up we'll have to make a body for the spirit. A body is the collision of the spirit, basically. A spirit in itself cannot collide with anything. This is all quite easy as we can use the code
CODE
player:makeBodyRectangle(offset_x,offset_y,size_x,size_y)

This basically makes a body for the spirit "player". Where the offsets are the offset position of the body compared to the spirits position, and the sizes are the size of the rectangled body.
In our example we'll use 0,0,40,65.

Now this doesn't really show anything, what we need to do is create an image to use for our spirit.
First, we have to make the image. We do this by using
CODE
makeImage()

and ofcourse we have to name it in order to control it. We'll call it playerImage.
This is done as above by using
CODE
playerImage = makeImage()

Next up we'll have to position our image relative to the spirit. There are many different ways of doing this. The most obvious one would be setPosition(x,y), however, MechaSource has smarter methods.
We can use the functiom
CODE
playerImage:setMother(mothertype, mother)

This sets our playerImage to a child of player (which was our spirit). A child does whatever the mother does, it's position and rotation is the same as the mothers. In "mothertype" we use "spirit" as we are trying to do hook onto a spirit, and "mother" is "player" because we wanna hook onto the spirit named "player".
Result is
CODE
playerImage:setMother("spirit", player)

Note that player does not contain quotations. This is because it's a variable.

All left to do is load a picture onto our image.
The command for that is
CODE
setImage(image path)

incase you haven't figured out yet, you add "playerImage:" in front of that so that MechaSource knows its for that image.
In this demonstration we'll use this image:
user posted image
(you might be asking "why the wierd shape?", we'll get to that later in part 2)
I have this image located in my "images" folder and the image is called "playerbody.png". Note that all files should be located inside your games Develop folder.

As a last thing, we need to set our images center. This is the point where the image rotates around. The code for this is:
CODE
setCenter(x,y)

where x is the position in pixels of the horizontal center, and y the same but vertical. Now, we could specify the center in pixels, but if we use 100000, it will automatically figure out the center of the image. If we use 110000, it'll automatically figure out the left/bottom side.
Let's do playerImage:setCenter(100000,100000).

Now what your script should look like is this:
user posted image

One thing we need to do though! Currently our script won't run as it isn't connected with Main.lua. Open up main.lua and add this function
CODE
require(file path)

where "file path" will be "player" (require("player")) as we need to load our player.lua.

That being said, let's try and run it!
user posted image
... that was very... exciting.
What just happened was our player that fell from his standard position (0,0) and to the ground. He starts at 0,0 since we didn't set the spirits position. Next we're gonna make him reacht when certain keys are being pressed.

We'll do that in part 2!


--------------------




MechaWare GamesMechaSourceMechaWare for CellphonesMechaWare on Steam

PMUsers WebsiteMSN
Top
United States
maxfreak
Posted: Aug 30 2008, 08:36 PM
Quote Post


Regular
[*]

Group Icon
Group: Members
Posts: 196
Member No.: 3740
Joined: 7-May 07

Status: (0d) [--]


Wow mecha, this sounds and looks very accesible! Great job!
PMEmail PosterYahooMSN
Top
Denmark
Mecha the Slag
Posted: Aug 30 2008, 08:43 PM
Quote Post


http://mechaware.net
[*][*][*][*][*]
[*][*][*]

Group Icon
Group: Members
Posts: 11816
Member No.: 728
Joined: 15-December 04

Status: (0d) [--]


Sorry about the fact that it has an inbuild platformer by default. We're discussing whenever we should include a bottom when creating your game that says "use default template".


--------------------




MechaWare GamesMechaSourceMechaWare for CellphonesMechaWare on Steam

PMUsers WebsiteMSN
Top
United States
DR. Demon Lizardman
Posted: Aug 30 2008, 09:23 PM
Quote Post


No comment
[*][*][*][*][*]


Group Icon
Group: Members
Posts: 8438
Member No.: 2995
Joined: 28-November 06

Status: (0d) [--]


This looks beautiful, good luck with finishing this!


--------------------
For best ref of all, check this one out, thanks Ashura.
QUOTE
Ashura please don't tell me you've done what I think you've done
PMEmail Poster
Top
Denmark
Mecha the Slag
Posted: Aug 30 2008, 09:24 PM
Quote Post


http://mechaware.net
[*][*][*][*][*]
[*][*][*]

Group Icon
Group: Members
Posts: 11816
Member No.: 728
Joined: 15-December 04

Status: (0d) [--]


Hope this update wasn't too complicated. Even though I posted like a million lines, I'm just terrible at explaining 5 lines of code :x


--------------------




MechaWare GamesMechaSourceMechaWare for CellphonesMechaWare on Steam

PMUsers WebsiteMSN
Top
United States
OniLink10
Posted: Aug 30 2008, 09:54 PM
Quote Post


C++ Programmer, Unofficial Physicist, and Unofficial Chemist
[*][*]

Group Icon
Group: Members
Posts: 3920
Member No.: 4907
Joined: 19-February 08

Status: (0d) [--]


Looks great so far! In Part 2 will it explain Creating Ground and Movement?


--------------------
QUOTE (Xgoff @ Sep 10 2009 @ 06:11 PM)
did you try hello's engine

make sure to not ****ing change anything before using it!
PMEmail PosterUsers WebsiteYahoo
Top
Brazil
Drezus
Posted: Aug 30 2008, 11:01 PM
Quote Post


ASH STARES INTO YOUR CHEEKS
[*][*]

Group Icon
Group: Members
Posts: 2236
Member No.: 2670
Joined: 15-September 06

Status: (0d) [--]


It looked slight complicated to do that engine like you said in your post, but if you said you couldn't explain 5 lines the (easier-looking) way you wanted, them I suppose it shouldn't be that hard.

But I might say I'm totally unfamiliarized, so I'm bit afraid of trying anything on it.


--------------------
user posted image
--------------------
user posted image

user posted image
PMEmail PosterIntegrity Messenger IMMSN
Top
Denmark
Mecha the Slag
Posted: Aug 31 2008, 03:43 AM
Quote Post


http://mechaware.net
[*][*][*][*][*]
[*][*][*]

Group Icon
Group: Members
Posts: 11816
Member No.: 728
Joined: 15-December 04

Status: (0d) [--]


QUOTE (Drezus @ Aug 31 2008, 06:01 AM)
It looked slight complicated to do that engine like you said in your post, but if you said you couldn't explain 5 lines the (easier-looking) way you wanted, them I suppose it shouldn't be that hard.

This is what I spend my post explaining
user posted image
and it's pretty simple.

QUOTE (OniLink10)
Looks great so far! In Part 2 will it explain Creating Ground and Movement?

It won't explain how to create ground, we'll do that later on while explaining how the Map Maker works.


--------------------




MechaWare GamesMechaSourceMechaWare for CellphonesMechaWare on Steam

PMUsers WebsiteMSN
Top
Qatar
Keyser Soze
Posted: Aug 31 2008, 03:49 AM
Quote Post


The Lights are Going Off
[*][*][*]

Group Icon
Group: Members
Posts: 4673
Member No.: 3299
Joined: 13-February 07

Status: (0d) [--]


QUOTE (MechaBowser @ Aug 31 2008, 03:43 AM)
This is what I spend my post explaining
user posted image
and it's pretty simple.

QUOTE (OniLink10)
Looks great so far! In Part 2 will it explain Creating Ground and Movement?

It won't explain how to create ground, we'll do that later on while explaining how the Map Maker works.

Assuming map maker=level builder?


--------------------
QUOTE (
Raie @ Sep 18 2009, 08:55 PM)
Keyser you're the best person ever.
PMEmail PosterYahooMSN
Top
Denmark
Mecha the Slag
Posted: Aug 31 2008, 03:59 AM
Quote Post


http://mechaware.net
[*][*][*][*][*]
[*][*][*]

Group Icon
Group: Members
Posts: 11816
Member No.: 728
Joined: 15-December 04

Status: (0d) [--]


QUOTE (Keyser Soze @ Aug 31 2008, 10:49 AM)
Assuming map maker=level builder?

Yes. It allows you to build levels for your game, where you can pretty much customize everything. Not only that, but the player can develop levels for your game using it, if the game allows it.


--------------------




MechaWare GamesMechaSourceMechaWare for CellphonesMechaWare on Steam

PMUsers WebsiteMSN
Top
United States
OniLink10
Posted: Aug 31 2008, 04:03 AM
Quote Post


C++ Programmer, Unofficial Physicist, and Unofficial Chemist
[*][*]

Group Icon
Group: Members
Posts: 3920
Member No.: 4907
Joined: 19-February 08

Status: (0d) [--]


QUOTE (MechaBowser @ Aug 31 2008, 01:43 AM)
QUOTE (OniLink10)
Looks great so far! In Part 2 will it explain Creating Ground and Movement?

It won't explain how to create ground, we'll do that later on while explaining how the Map Maker works.

Ok then. XD


--------------------
QUOTE (Xgoff @ Sep 10 2009 @ 06:11 PM)
did you try hello's engine

make sure to not ****ing change anything before using it!
PMEmail PosterUsers WebsiteYahoo
Top
United Kingdom
Gamesmonkey
Posted: Aug 31 2008, 05:17 AM
Quote Post


More badass than anything else ever
[*][*]

Group Icon
Group: Members
Posts: 1499
Member No.: 3336
Joined: 21-February 07

Status: (0d) [--]


Nice! When you finish the Platformer tutorial, put it in a PDF, okay?


--------------------
user posted imageuser posted image
PMEmail PosterUsers WebsiteAOLYahooMSN
Top
Denmark
Mecha the Slag
Posted: Aug 31 2008, 05:20 AM
Quote Post


http://mechaware.net
[*][*][*][*][*]
[*][*][*]

Group Icon
Group: Members
Posts: 11816
Member No.: 728
Joined: 15-December 04

Status: (0d) [--]


QUOTE (Gamesmonkey @ Aug 31 2008, 12:17 PM)
Nice! When you finish the Platformer tutorial, put it in a PDF, okay?

Okay sure, I can easily do that.


--------------------




MechaWare GamesMechaSourceMechaWare for CellphonesMechaWare on Steam

PMUsers WebsiteMSN
Top
Netherlands
Neopolis
Posted: Aug 31 2008, 05:31 AM
Quote Post


Abandon ship!
[*][*][*][*][*]
[*][*]

Group Icon
Group: Members
Posts: 8632
Member No.: 2034
Joined: 24-April 06

Status: (0d) [--]


Lua isn't really as hard as it looks. It's actually slightly similar to GML. And with all the MechaSource commands and a reference manual nearby, it's really no trouble.


--------------------
Neopolis is preparing for the incoming apocalypse
(And a drawing reference.)
PMEmail PosterAOLMSN
Top
Dominican Republic
~Smoke~
  Posted: Aug 31 2008, 05:42 AM
Quote Post


OH MAN I ALMOST GOT A HEART ATTACK THERE!
[*][*][*]

Group Icon
Group: Members
Posts: 3221
Member No.: 2504
Joined: 15-August 06

Status: (0d) [--]


QUOTE (Neopolis @ Aug 31 2008, 05:31 AM)
Lua isn't really as hard as it looks. It's actually slightly similar to GML. And with all the MechaSource commands and a reference manual nearby, it's really no trouble.

so lua is easy....sweet cool2.gif


--------------------

user posted imageuser posted imageuser posted imageuser posted imageuser posted image
user posted image
DAY 5
Revisit all the Events, Click a Picture
PMEmail PosterUsers WebsiteIntegrity Messenger IMAOLYahooMSN
Top
Finland
Hohoo
  Posted: Aug 31 2008, 05:50 AM
Quote Post


BAN AUTOTUNE
[*][*][*]

Group Icon
Group: Members
Posts: 1562
Member No.: 3062
Joined: 14-December 06

Status: (0d) [--]


Is there a possiblity to use Python?

If I ever use this, I don't want to learn a new language.


--------------------

user posted image

Reference

Mickeysoft Internet Explorer

MKE


cat /usr/share/icons/*/* > /dev/dsp
user posted image
NOW IS EXCITING COMING
Johto > Hoenn > Sevii > Sinnoh > Kanto
PMUsers Website
Top
Denmark
Mecha the Slag
Posted: Aug 31 2008, 06:21 AM
Quote Post


http://mechaware.net
[*][*][*][*][*]
[*][*][*]

Group Icon
Group: Members
Posts: 11816
Member No.: 728
Joined: 15-December 04

Status: (0d) [--]


QUOTE (Hohoo @ Aug 31 2008, 12:50 PM)
Is there a possiblity to use Python?

Unfortunately, no. MechaSource is lua based, however, modified and simplified so much it's totally easier.


--------------------




MechaWare GamesMechaSourceMechaWare for CellphonesMechaWare on Steam

PMUsers WebsiteMSN
Top
Finland
Hohoo
  Posted: Aug 31 2008, 06:47 AM
Quote Post


BAN AUTOTUNE
[*][*][*]

Group Icon
Group: Members
Posts: 1562
Member No.: 3062
Joined: 14-December 06

Status: (0d) [--]


QUOTE (MechaBowser @ Aug 31 2008, 02:21 PM)
Unfortunately, no. MechaSource is lua based, however, modified and simplified so much it's totally easier.

Then another question: how is MechaSource programmed? A programming language or MMF/GM?


--------------------

user posted image

Reference

Mickeysoft Internet Explorer

MKE


cat /usr/share/icons/*/* > /dev/dsp
user posted image
NOW IS EXCITING COMING
Johto > Hoenn > Sevii > Sinnoh > Kanto
PMUsers Website
Top
Denmark
Mecha the Slag
Posted: Aug 31 2008, 07:11 AM
Quote Post


http://mechaware.net
[*][*][*][*][*]
[*][*][*]

Group Icon
Group: Members
Posts: 11816
Member No.: 728
Joined: 15-December 04

Status: (0d) [--]


QUOTE (Hohoo @ Aug 31 2008, 01:47 PM)
Then another question: how is MechaSource programmed? A programming language or MMF/GM?

MMF2 + Lua + Python


--------------------




MechaWare GamesMechaSourceMechaWare for CellphonesMechaWare on Steam

PMUsers WebsiteMSN
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

  Topic Options Topic Options Pages: (87) « First ... 8 9 [10] 11 12 ... Last » Reply to this topicStart new topicStart Poll

 




[ Script Execution time: 0.1357 ]   [ 13 queries used ]   [ GZIP Enabled ]   [ Server Load: 1.16 ]