Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411562 Posts in 69384 Topics- by 58444 Members - Latest Member: darkcitien

May 04, 2024, 02:04:16 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityTownhallbluemoon - Game Development tool based on Lua
Pages: [1]
Print
Author Topic: bluemoon - Game Development tool based on Lua  (Read 3493 times)
MikeDee
Level 1
*



View Profile
« on: July 18, 2009, 06:59:01 PM »

bluemoon is a game development tool for Windows, comprising of a 2D display engine, and a IDE and compiler for the bluemoon programming language which is based on Lua and perfect for experts and beginners and experts alike.
It's easy to learn yet powerfull syntax and commands makes for a great way of starting off with programming and get ready to make great games, while at the same time providing the flexibility to create whatever you want, whether you are an expert or someone new to programming.

bluemoon's license allows everyone to release their creations the way they want, commercially or not.

At this point, it might have a few bugs but it's stable enough to start developing seriously with it.

It comes with a fully commented Breakout example, which is a pretty good starting point.

Feedback and bug reports are very very important at this stage, so don't be shy !

site:
http://bluemoonhome.freehostia.com

download beta:
http://bluemoonhome.freehostia.com/downloads.php?cat_id=1
Logged
Dim_Yimma_H
Level 1
*



View Profile
« Reply #1 on: July 27, 2009, 10:04:39 AM »

Feedback and bug reports are very very important at this stage, so don't be shy !

Edit: I understand the reason for the installation package now, it's probably the only way to be able to launch the compiler with the source code files.

I looked around your website and would guess it may benefit from some feature highlighting as it seems that setup file is the only way to see the actual language. So maybe it would increase interest if some code examples were available, as the code is what's interesting for programmers (if the tool is mostly for programming)

Like many others I do have a tool-set I'm content with, but I have to admit that I was interested enough to glance at this one anyway.
« Last Edit: September 06, 2009, 01:53:15 AM by DimJimma » Logged

MikeDee
Level 1
*



View Profile
« Reply #2 on: July 27, 2009, 04:57:19 PM »

mmh great suggestion, thanks a bunch for the heads up, actually it's something I hadn't thought about.  Embarrassed
Logged
Dim_Yimma_H
Level 1
*



View Profile
« Reply #3 on: July 28, 2009, 12:50:08 PM »

Does "based on Lua" mean that the language follows the Lua syntax and all that (and adds bluemoon-specific functions), or does it mean that it's a modified version of Lua?

I'm actually planning to learn Lua pretty soon, so I guess this tool may be a nice way to practice the language and actually accomplish something visual too - Because I've heard it's a bit of a hazzle to bind it to C++ first.

I also saw the screenshot of a bluemoon code snippet in the gallery and it seems pretty neat, I think I'll try it out some.
Logged

MikeDee
Level 1
*



View Profile
« Reply #4 on: July 29, 2009, 04:11:26 PM »

"based on Lua" mean that the language follows the Lua syntax and all that (and adds bluemoon-specific functions)"
this  Wink

Yeah binding it with C++ can be a pain, specially if you don't have much programming experience, while Lua is really easy to learn.

thanks btw :D
Logged
Dim_Yimma_H
Level 1
*



View Profile
« Reply #5 on: September 06, 2009, 02:04:43 AM »

This inspired me to practice some Lua, so I gave it a try, and did the following example program. Hopefully it gives an idea of how relatively easy it's to get up and running with the code. I have some feedback about the beta editor which I'll try posting on that website forum if I see the server come back online.

Complete program code for controlling a sprite that can push another sprite with collision detection, on a floor of sprites:

Code:
--simple program for controlling one object,
--and pushing another object around



--window dimensions:

screen_width=500
screen_height=500
window_offsetx=0
window_offsety=32 --border size, this may vary with different Windows settings

--initial coordinates for objects:

obj1_x=200.0
obj1_y=250.0

obj2_x=400.0
obj2_y=250.0

--velocity constants:

gravvel_y = 6.0
movespeed_x = 6.0
flyvel_y = -12.0 --"eliminate" gravity, then add fly velocity



--function: bleumoon setup callback

function setup()

--screen

fps=30
setscreen(500,500)

--objects

obj1=createobject("Obj1_48x48.bmp")
obj2=createobject("Obj2_48x48.bmp")
positionobject(obj1,obj1_x,obj1_y)
positionobject(obj2,obj2_x,obj2_y)

--create tile row, on bottom of screen

for x=24, screen_width+24, 48 do

local tile=createobject("Tile48x48.bmp")
positionobject(tile, x+window_offsetx, screen_height-window_offsety-24)

end

--create text for debugging

debugger=createtext("Debugging")
positiontext(0,0)

end



--function: bluemoon main loop callback

function mainloop()

settext(debugger, "Press Space to reset")
if (keypressed.space == 1) then
positionobject(obj1,obj1_x,obj1_y)
positionobject(obj2,obj2_x,obj2_y)
end

--1. add pseudo-gravity to object
--2. (control object with input)
--3. ensure object is within boundaries/screen
--(repeat for each object)

moveobject(obj2,0,gravvel_y)
boundobject(obj2, 0,screen_width, 0,screen_height-window_offsety-48)

moveobject(obj1,0,gravvel_y)
controlobject(obj1)
pushobject(obj1,obj2)
boundobject(obj1, 0,screen_width, 0,screen_height-window_offsety-48)

end



--function: tests if an object is within boundaries
--input: obj - object to test
-- x1 - min-x boundary
-- x2 - max-x boundary
-- y1 - min-y boundary
-- y2 - max-y boundary
--return: true if object is already within boundaries, false if it had to be moved into boundaries

function boundobject(obj, x1,x2, y1,y2)

local obj_x = objectx(obj)
local obj_y = objecty(obj)

--local obj_ex = objectxsize(obj) / 2 --not implemented?
--local obj_ey = objectysize(obj) / 2 --not implemented?
local obj_ex = 24
local obj_ey = 24

local bound = true

if (obj_x-obj_ex < x1) then
obj_x = x1+obj_ex
bound = false
end

if (obj_x+obj_ex > x2) then
obj_x = x2-obj_ex
bound = false
end

if (obj_y-obj_ey < y1) then
obj_y = y1+obj_ey
bound = false
end

if (obj_y+obj_ey > y2) then
obj_y = y2-obj_ey
bound = false
end

positionobject(obj,obj_x,obj_y)
return bound

end



--function: applies movement to object, in response to control

function controlobject(obj)

if (keypressed.right == 1) then
moveobject(obj,movespeed_x,0)
end

if (keypressed.left == 1) then
moveobject(obj,-movespeed_x,0)
end

if (keypressed.up == 1) then
moveobject(obj,0,flyvel_y)
end

end



--function: lets an object push another on its sides, or lets it stay on top of it
--input: obj1 - "pusher"
-- obj2 - to be pushed

function pushobject(obj1,obj2)

local obj1_x = objectx(obj1)
local obj1_y = objecty(obj1)
local obj1_ex = 24 --objectxsize(obj1) / 2
local obj1_ey = 24 --objectysize(obj1) / 2

local obj2_x = objectx(obj2)
local obj2_y = objecty(obj2)
local obj2_ex = 24 --objectxsize(obj2) / 2
local obj2_ey = 24 --objectysize(obj2) / 2

--check if objects overlap vertically

if (obj1_y+obj1_ey >= obj2_y-obj2_ey) and (obj1_y-obj1_ey < obj2_y+obj2_ey) then

--check if obj1 is just on top of obj2,
--if so stay on top (don't push)

if (obj1_y+obj1_ey <= obj2_y-obj2_ey+gravvel_y)
and (obj1_x+obj1_ex > obj2_x-obj2_ex) and (obj1_x-obj1_ex < obj2_x+obj2_ex) then

positionobject(obj1, obj1_x, obj2_y-obj2_ey-obj1_ey)
settext(debugger, "On top")
return

end

--check if obj1 "right" is inside obj2
--if so, try pushing obj2 to right

if (obj1_x+obj1_ex >= obj2_x-obj2_ex) and (obj1_x+obj1_ex < obj2_x+obj2_ex) then

local dx = obj1_x+obj1_ex - (obj2_x-obj2_ex)

if (can_moveobject(obj2, dx,0) == true) then
positionobject(obj2, obj2_x+dx, obj2_y)
settext(debugger, "Pushing")
else
positionobject(obj1, obj1_x-dx, obj1_y) --stopped by wall, move back
settext(debugger, "Stopped by wall")
end

return

end

--check if obj1 "left" is inside obj2
--if so, try pushing obj2 to left

if (obj1_x-obj1_ex > obj2_x-obj2_ex) and (obj1_x-obj1_ex <= obj2_x+obj2_ex) then

local dx = obj2_x+obj2_ex - (obj1_x-obj1_ex)

if (can_moveobject(obj2, -dx,0) == true) then
positionobject(obj2, obj2_x-dx, obj2_y)
settext(debugger, "Pushing")
else
positionobject(obj1, obj1_x+dx, obj1_y) --stopped by wall, move back
settext(debugger, "Stopped by wall")
end

return

end

end

return false

end



--function: tests if object can be moved without exceeding boundaries
--input: obj - object to test if it can be moved
-- dx - movement along x-axis (relative)
-- dy - movement along y-axis (relative)
--return: true if object can be moved by (dx,dy)

function can_moveobject(obj, dx,dy)

--store current coordinates, then test-move object
local obj_x = objectx(obj)
local obj_y = objecty(obj)

--1. move forward
--2. test against boundaries
--3. move back again

positionobject(obj, obj_x+dx, obj_y+dy)
can_moveobject_ret = boundobject(obj, 0,screen_width, 0,screen_height-window_offsety-48)
positionobject(obj, obj_x,obj_y)

return can_moveobject_ret

end
Logged

ElijahKatz
Level 1
*


View Profile
« Reply #6 on: September 06, 2009, 11:34:49 AM »

Looks interesting...
I'm downloading right now Corny Laugh

EDIT: links aren't working
Logged
Hideous
That's cool.
Level 10
*****


3D models are the best


View Profile WWW
« Reply #7 on: September 06, 2009, 01:40:50 PM »

I feel like saying something along the lines of "How many times am I gonna use THIS? Uh, like, once in a blue moon" just to make a pun, but that would be mean.
Logged

deathtotheweird
Guest
« Reply #8 on: September 06, 2009, 04:21:46 PM »

Hm, your site appears to be down. I remember checking this out months ago, can't remember which version it was, can't find the setup file on my computer either. I promised myself to check it out when it matured to version 1 though. But I can't because the site is down.  Undecided
Logged
MikeDee
Level 1
*



View Profile
« Reply #9 on: September 07, 2009, 03:41:51 AM »

sorry guies, I noticed this a few days ago, the host says they are having a problem with some of their servers, one of the being where the site is located.

DimJimma: Thanks for the sample code, and thanks for offering your feedback I'll try to get the website running again as fast as possible.
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic