kk, i'll try and give it to you, its gonna be simple cos its part of something huge!
Also, why aint this a sticky anymore?
Printable View
kk, i'll try and give it to you, its gonna be simple cos its part of something huge!
Also, why aint this a sticky anymore?
Yea I dunno why its not a sticky. Its harder to find.
I got two questons
1.
Can any one help me I want my program to Save a irda signal to a variable on a botton press while selecting an object on a menu.
This is what I have so far:
2.Code:if pad:circle() and menustatus == -1 then
irdasignal = System.irdaRead()
end
when I hit left or right my pic. doesnt move but when I hit up or down it moves .
Code:red = Color.new(255, 0, 0);
white = Color.new(255, 255, 255);
char = Image.load("char.png")
y = 100
x = 100
while true do
screen:clear()
-- read current pad
pad = Controls.read()
if pad:up() then
y = y - 1
elseif pad:down() then
y = y + 1
elseif pad:left() then
X = x - 1
elseif pad:right() then
X = x + 1
end
screen:blit(x, y, char, 0, 0, char:width(), char:height(), true)
screen.flip()
screen.waitVblankStart()
if pad:start() then break end
end
1. I dont use IRDA so i don knowZitat:
Zitat von zmathue
2.
Code:red = Color.new(255, 0, 0);
white = Color.new(255, 255, 255);
char = Image.load("char.png")
y = 100
x = 100
while true do
screen:clear()
-- read current pad
pad = Controls.read()
if pad:up() then
y = y - 1
elseif pad:down() then
y = y + 1
elseif pad:left() then
X = x - 1
elseif pad:right() then
X = x + 1 --Caps lock on for first X but not on for 2nd X, same with Pad:left().
end
screen:blit(x, y, char, 0, 0, char:width(), char:height(), true)
screen.flip()
screen.waitVblankStart()
if pad:start() then break end
end
for the ir signal, my only advice would be to look at the ir source code of the program that is bundled into lua player when u get it.
um all that does is store it to the variable for like a second then the variable is replaced with null or another empty data.
Whar is the Analog configuration how do i use it EX:
if nub:up() then ...
i think its:Zitat:
Zitat von ZereoX
if pad:analog() >/</~=/== [number in degrees] then
ex.
if pad:analog() > 45 then
screen:print(10, 10, "Test", red)
end
This means that if the Analog is at a angle that is greater than 45 Degrees then the text will print.
--Vaza
Thanks Vaza... That help me alot too!
(Off subject) haha... it won't let you post screen: print!
what sound files does lua player surrport>
is it just mod an wav,, or is there anything else
The Mod family and WAV.Zitat:
Zitat von Sousanator
Mod Family consists of Mod, XM, IT, S3M and many more.
--Vaza
thanks,,
but when i convert a mid to an xm, or it,, it wont play right,, is that normal,
errr, didn't think so...
i just did a whole bunck of checks,,
turns out im processing too much at the same time,, cause the music to be chuncky,,
anyway to avoid that(on pc, it sounds nice)
and what is the proper way to exit your game from lua player,,
since break, just breaks the loop,, (and music continues and such)
Zitat:
Zitat von Sousanator
yes i hate it when i quit a game and the music is still playing from it.
well you got to kill the music playing before you exit.
anyone good with AI? i have a game with AI but it wont load :(
Anyone has a good and easy wait to make a scrolling map where you can move a guy.
but even if you do that, the game still continues to run in the bgZitat:
well you got to kill the music playing before you exit.
It does say so, but if you think about it, you do exit the game loop so it isn't running anymore. I don't know why its saying it is.
@Vaza
transparency:
This will create a square of width and height, ay x and y, that has a half-transparant red color. The boldfaced 128 is why its half-transparant. 255 would mean fully transparant and 0 not transparant. Also you have to put true in screen:blit so it knows there are transparant pixels in the image.Code:redTrans=Color.new(255, 0, 0, 128)
transparantPic=Image.createEmpty(width, height)
transparantPic:clear(redTrans)
screen:blit(x,y,image,0,0,width,height,true)
jw but is their a not symbol?
edit: also what does the following error mean?
lua:14240: control structure too long neas ','
?
here is the line it is talking about:
for i = 1,42 do
ive tried both v1 and v2 of the lua solitaire and they both load but freeze when i click any button, can you tell me what im doing wrong? :Cry:
they may call kernal commands are they lua files? (sorry not looking for them but if they are i could take a look)
hi,
how do you call certain images from a sprite set?
eg how would i select the bottom middle one from the sheet below?
http://www.gamingw.net/file/resource...acter//alf.PNG
Edit: the image size is 144x256
just make independent pics of each on:
like if you want the bottom left one you copy his pic onto a new image (just him use paint if you don't have anything that can modify pics)
then load his pic and call him in your program when need him
ok thanks i thought i would be the easiest way but wanted to make sure it couldnt be done without using paint. Thanks again
anyone good with artificial intelligence? if so pm me cuz i need some quick help! thanks
Try to just think logical, with several steps if to take action or not.
But it really depends on what type of game you are creating.
so anyways how about my question?
Slice you got and error lua.14240 that means there somthing wrong on that line i just dont hope you have that much lines.Post a part of you code.
ok :
well 1. that's only half way down my code i really have: 34139 lines of code
2. it's worked untill i put the line beforehand so thus i ask what is the not symbol?
Anyone?!?!Zitat:
Zitat von Bronx
@Slicer:The not symbol is "~"
@Bronx: Have you tried the tuts by Vaza? If so, I dont have any better advice. I have to get started with AI myself.
You can "grab" a smaller image from a bigger one. You dont have to have them as seperate files. Altough that might be easier, but I believe this way the total image filesize is smaller. What you have to do for the bottom middle is this:Zitat:
Zitat von JoeDaStudd
where newImage becomes your bottom middle image.Code:newImage:blit(0,0,sprite,49,193,48,192)
(I assumed one smaller piece is 144/3=48 wide and 256/4=64 high)
Woops! doublepost... :icon_cool
For the error, check here: http://www.lua.org/source/4.0.1/src_lcode.c.htmlZitat:
Zitat von slicer4ever
Unfortunately I dont know C so someone else will have to explain this to you. Maybe the for loop is to big? As in 42 is to big? Cant imagine why though.
slice4ever - I need to see the line before that for loop and the line after the for loop...
By the looks of it, you have a structure above the for loop, and you have set too large of a value/data type in it... im just guessing though, so...
yeah, i have used vaza's tut. but the cars only go one direction :p
ok well then since when the games finished it well be open-source anyways i'll post my code just give me about 5 min to transfer it from my laptop(reason why i didn't post it before)
edit: o and i thought the ~ was congruent not the not symbol do to in math you
use:
~
=
to represent congruency but whatever that well allow me to optimize my code a lot more
wait then i'm stupid cause == is congruency and i've neven even notice so well someone give me my sign i guess...
edit2: k here we go: dl a working version and a non working version (the line for non-working is on 14240 and search for -- in the working to figure out where the code is that's surpose to be there
note i know this is a highly un-optimized codeing but that well be improved upon in the future
here:
http://slicer4ever.50megs.com/lua%20risk.rar
Well.... in C the 'not equal to' operator is the !...
if ( true != 1 )
break;
}
yea same for flash so why i tried that i kept thinking ~= ment congruent not,not
edit: since the new copyright thing has came out i have all my own pic's(thanks to deanaw22) i'm just using the idea and name would i need to change the name and if so i'll change it to:
the world domination game
edit: also you forgot your opening bracket also isn't 1 another way for saying true where's 1 is true and 0 is false or is that only on calculators?
boolean is: true and false
1 and 0 are just numbers. They could just as easily been 9 and 374 for that matter. It depends on what you associate them with.
BTW I can't download the file, or is it already gone or something? It says Forbidden!