Advertisement

Quick2D, Free Game Enginee

Started by September 28, 2012 12:22 PM
5 comments, last by Quick2D 12 years, 2 months ago
Hello,
I'm new here, pardon me if I made this topic in a wrong place.
I have a small game making studio and we make indie games. recently I've decided to have an independent game engine for my studio.
This engine's called Quick2D. its a free engine for making 2D games and still in developing process.

Download Here

old descriptions here, follow the last post for the last news

For now, it has no editor, you can use any editor of your choise, like Notepad++ .
In this package, there's a main.js file which includes some base codes and not used variables just to show you how things look and are gonna work.

Once you're script is done, simply run it by Dragging it on the core <Quick2D.exe>. there is no independent exe version of your game yet but it'll be added as soon as the main developing process of the engine is over.

You can have your own script like myname.js or anything else, also additional script files can easily be attached.

Functions and Parameters available in this version:
[source lang="jscript"]double = load_texture (string);
draw_sprite (id, x, y);
draw_text (text, size, x, y);
set_origin (id, x, y);
set_cursor ("visible" or "invisible");
set_title (title);
set_screen (width, height);
get_width (id);
get_height (id);
double = screen_width;
double = screen_height;
exec ("script.js");
alert (message);
double = random (max);
window_mode (0 or 1);
quit ();
double = Length (string);
double = check_collision (id1, id2);[/source]
Events available in this version:
[source lang="jscript"]onMouseButtonPressed (e)
onMouseButtonReleased (e)
onMouseMove (e)
onMouseWheelMoved (e)
onKeyPressed (e)
onKeyReleased (e)[/source]

There are 3 main Events/Functions that you should never attempt to delete them, Project_Settings, Start and Update.

Project_Settings will be called at the beginning of your game once and for all. in this event you can set your project settings like Windowed or Fullscreen, window size, window title, etc...

Start will be called once after Project_Settings. its the best place to initialize your variables.

Update is the main loop of the game. nothing fancy.

In Mouse Button events, e contains Button, X, Y (small and capital letters are important)
[source lang="jscript"]if (e.Button+""=="Left")
{
// Your code
}[/source]
You have to convert Button to string. it'll be fixed in the next version.

The function exec is for calling scripts from outside of the main script. simply put it at the beginning of Start event.
get_width and get_height are usable to get sprites sizes by giving them the sprite id.
And remember, never use load_texture in Update event.

Empty template for main.js:
[source lang="jscript"]function Project_Settings(id)
{

}
function Start(id)
{

}
function Main(id)
{

}[/source]


Tutorials
- Character Animation Tutorial

Feel free to ask any question here smile.png I'll be responser.
Regards

More downloads and tutorials on http://quick2d.wordpress.com/


I have a small game making studio and we make indie games

Can you give more information about your game studio, some screenshots, website etc. Your game engine is (packed) <1mb, that is not much. To be honest, I would never test it out of fear of getting a keylogger or other malware installed on my PC. If it is a self written malware, it is likely that no anti-malware tool will detect it.
Advertisement
yes of course. I wouldn't blame you. besides, my engine is mostly the core. as I said, it has no editor yet. the name of my studio is Bluebulk and you can visit the website at www.bluebulk.info and the mini games we've made. its based in Mölln, Germany.

Edit:
Also if you or anyone else are afraid of keyloggers or trojans or anything like that, you can easily set your firewall to interactive mode and if my engine wanted to connect to internet, block it !
Tutorial:: How to make character animation

- first, make a file named "character_animation.js" and put the tamplate in it:
[source lang="jscript"]function Project_Settings(id)
{

}
function Start(id)
{

}
function Main(id)
{

}[/source]
- Go to the Sprites folder and put character folder in it. (files are attached)

[attachment=11506:character.rar]

- define these variables:
[source lang="jscript"]var speed, is_down, f, x, y, timer;
var frames=new Array();[/source]
- in Project_Settings :
[source lang="jscript"]set_title("Character Animation");
window_mode(0);
set_screen(800,600);[/source]
in the first line, we set the window title, next we set it to windowed and finally set the resolution to 800x600 pixels.

- in Start event, lets initialize our variables:
[source lang="jscript"]speed=0;
f=0;
timer=0;
x=100;
y=250;
is_down=false;[/source]
- after that, we need to fill our array with frames. so:
[source lang="jscript"]
for (var i=0; i < 8; i+=1)
{
frames=load_texture("character\\"+(i+1)+".png");
}[/source]

now we're set to go.
- in Main event, draw the character using draw_sprite function :
[source lang="jscript"]draw_sprite(frames[f],x,y);[/source]
- now we need to make a timer for frame animation :
[source lang="jscript"]if (is_down)
{
if (timer < 4)
{
timer+=1;
}else{
timer=0;
f+=1;
if (f > 7)
{
f=0;
}
}
}[/source]
you can play with timer values to change the speed of the animation.
now its time to move our character using keyboard.
I'll do it for one direction, you do the rest ;)

- make a keyboard keypress event :
[source lang="jscript"]function onKeyPressed(e)
{

}[/source]
- add following lines in it :
[source lang="jscript"]if (e=="Right")
{
is_down=true;
}[/source]
it says if you press the Right arrow on your keyboard, it'll start moving. now lets stop it on releasing the key !

[source lang="jscript"]function onKeyReleased(e)
{
if (e=="Right")
{
is_down=false;
f=0;
}
}[/source]
Time to move !
- get back to Main event and add this line after if (is_down){
[source lang="jscript"]x+=2;[/source]

Save your script and run your game by dragging character_animation.js onto <Quick2D.exe>

Feel free to ask your questions.

[attachment=11505:tutorial_character_animation.jpg]
Upcoming update: http://quick2d.wordpress.com/2012/09/28/some-features-of-rev-1-0-3/
Finally rev 1.0.3 is ready !
*=*=*=*=*=*=*=*=*=*=*=*=*
Download rev 1.0.3 (1.25Mb)
A mini game with source is included. not all functions are used in it though.

Functions and Parameters Added in this version:
[source lang="jscript"]LeftButton
RightButton
MiddleButton
rotate (id, angle)
double = xval_to_point (id, targetX, targetY, speed)
double = yval_to_point (id, targetX, targetY, speed)
double = xval_to_direction (id, angle, speed)
double = yval_to_direction (id, angle, speed)
angle = lookAt (id, targetX, targetY)
double = distance_to_point (id, targetX, targetY)
wait (milliseconds)
double = mouse_hit (id, mouseX, mouseY)[/source]

Screenshots of the sample project:

bubbkepoker_1.jpg?w=440
bubblepoker_2.jpg?w=440
Advertisement
Version 1.1.0 is out now !
Download it from here

In this version you see a flexible Editor. also we made lots of changes in the core and many bugs fixed. You can make different objects, set your project settings visually and run your games by simply click a button. some code snippets and easy to use event buttons, Audio engine and new algorithm to animate strip images. There is a sample project in the rar file. open Quick2D and hit the Folder button to open the project.
Functions and Parameters Added to this release:
[source lang="jscript"]ray_hit
draw_background
load_sound
play_sound
stop_sound[/source]

quick2d_.jpg?w=490
quick2d_s.jpg?w=490

This topic is closed to new replies.

Advertisement