This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Topics - flyingfisch
16
« on: October 28, 2012, 07:22:54 pm »
OK, here's my chess timer:
print("Chess timer starting...") --function variables local drawRectFill = zmg.drawRectFill local fastCopy = zmg.fastCopy local makeColor = zmg.makeColor local drawPoint = zmg.drawPoint local keyMenuFast = zmg.keyMenuFast local clear = zmg.clear local drawText = zmg.drawText local keyDirectPoll = zmg.keyDirectPoll local keyDirect = zmg.keyDirect local floor = math.floor local random = math.random local time = zmg.time local ticks = zmg.ticks
--screen vars local SCREEN_WIDTH = 384 local SCREEN_HEIGHT = 216 local exit = 0
--game variables local key = {F1=79, F2=69, F3=59, F4=49, F5=39, F6=29, Alpha=77, Exit=47, Optn=68, Up=28, Down=37, Left=38, Right=27, EXE=31} local chesstimer = {timerStart=60, add=0, turn="White", turnNum=1} local color = {bg=makeColor("white"), fg=makeColor("black")} local continue = 0 local intro = 1 local buffer = 0 local timers = {white=chesstimer.timerStart, black=chesstimer.timerStart} local start=0
--first poll and first start timer keyDirectPoll() local startTime = ticks()
--functions
local function timeElapsed() return floor((ticks()-startTime)/100) end
local function wait(timeToWait) local start = timeElapsed() while timeElapsed() - start < timeToWait do end end
local function waitForKey(key) while keyDirect(key) == 0 do keyDirectPoll() end end
local function toggleTurn() if chesstimer.turn == "White" then chesstimer.turn = "Black" chesstimer.turnNum = 2 else chesstimer.turn = "White" chesstimer.turnNum = 1 end start = timeElapsed() end
local function introScreen() continue = 0 drawText(1, 1, "WAIT...", color.fg, color.bg) fastCopy() wait(3) drawText(1, 1, "Press [EXE] to continue", color.fg, color.bg) fastCopy() waitForKey(key.EXE) intro = 0 end
local function chessTimerScreen() start = timeElapsed() while exit ~= 1 do if keyDirect(key.Exit) > 0 then exit = 1 elseif keyDirect(key.F1) > 0 then toggleTurn() end --drawing drawText(1, SCREEN_HEIGHT - 10, "Next Player", color.fg, color.bg) drawText(1, 1, "Turn: " .. chesstimer.turn, color.fg, color.bg) drawText(1, 10, "White: " .. timers.white, color.fg, color.bg) drawText(1, 20, "Black: " .. timers.black, color.bg, color.fg) --math timeElapsedSinceTurn = timeElapsed - start timers[chesstimer.turnNum] = chesstimer.timerStart - timeElapsedSinceTurn keyDirectPoll() end exit=0 intro=1 end
--main loop while exit~=1 do clear() --intro screen if intro == 1 then fastCopy() introScreen() end --wait screen drawText(1, 1, "Press F1 when ready", color.fg, color.bg) drawText(1, SCREEN_HEIGHT - 10, "Next Player", color.fg, color.bg) --wait waitForKey(key.F1) --chesstimer screen chessTimerScreen() --refresh screen fastCopy() --keypoll keyDirectPoll() end
print("done.") print("")
For some reason it freezes at "Press [EXE] to continue". I've been debugging it for a half an hour with no results so maybe someone with a fresh brain can help me see where my problem is?
17
« on: October 06, 2012, 12:33:42 pm »
Hi, I was just using Firefox's built-in inspect element tool and at the bottom of every page it shows this:
<iframe style="width: 330px; height: 0px; border: 0px none; position: fixed; bottom: 0px; right: 0px; padding: 0px; line-height: 1em; z-index: 2147483647; margin-right: 10px;" name="prestosavings-ifrm-01" id="prestosavings-ifrm-01" src="https://savecdn.com/addon/coupontool2/iframe.php"></iframe>
That scared me at first because I thought maybe my site was hacked or something but I checked other sites and found the same thing. If I use another browser, or view source, it is not there. So I guess it has to do with the inspector? Just wondering if anyone else had this happen to them.
18
« on: September 19, 2012, 04:40:13 pm »
I have started a project I am calling pong++. It is based on pong but will have lots of different modes. So far I have this: print("starting...")
print("defining functions") --function variables local drawRectFill = zmg.drawRectFill local fastCopy = zmg.fastCopy local makeColor = zmg.makeColor local drawPoint = zmg.drawPoint local keyMenuFast = zmg.keyMenuFast local clear = zmg.clear local drawText = zmg.drawText local keyDirectPoll = zmg.keyDirectPoll local keyDirect = zmg.keyDirect local floor = math.floor local random = math.random
print("setting vars") --screen vars local LCD_SCREEN_WIDTH = 384 local LCD_SCREEN_HEIGHT = 216
--game variables local key = {F1=79, F2=69, F3=59, F4=49, F5=39, F6=29, Alpha=77, Exit=47, Optn=68, Up=28, Down=37, Left=38, Right=27} local color = {makeColor("limegreen"),makeColor("black")} local ball = {x=20, y=20, width=8, height=8} local dir = {x=1, y=1} local speed = {x=2, y=2} local paddle = {player=40, width=8, height=30, speed=4} local wall = {width=8}
print("entering game loop") ----game loop---- while keyMenuFast() ~= key.Exit do ----DRAW---- --draw background drawRectFill(0,0,LCD_SCREEN_WIDTH,LCD_SCREEN_HEIGHT,color[2])
--draw ball drawRectFill(ball.x, ball.y, ball.width, ball.height, color[1])
--draw player paddle drawRectFill(0, paddle.player, paddle.width, paddle.height, color[1])
--draw wall drawRectFill(LCD_SCREEN_WIDTH-wall.width, 0, wall.width, LCD_SCREEN_HEIGHT, color[1])
----CONTROLS---- --control paddle if keyMenuFast()==key.Up and paddle.player>0 then paddle.player = paddle.player - paddle.speed elseif keyMenuFast()==key.Down and paddle.player<LCD_SCREEN_HEIGHT - paddle.height then paddle.player = paddle.player + paddle.speed end
----COLLISIONS---- --check for collisions if ball.x < 0 + paddle.width and ball.y > paddle.player and ball.y < paddle.player + paddle.height then ball.x = 0 + paddle.width dir.x=1 elseif ball.x < 0 then print("Game Over") break end
if ball.x>LCD_SCREEN_WIDTH - ball.width - wall.width then ball.x = LCD_SCREEN_WIDTH - ball.width - wall.width dir.x=-1 end
if ball.y<0 then ball.y=0 dir.y=1 elseif ball.y>LCD_SCREEN_HEIGHT - ball.height then ball.y = LCD_SCREEN_HEIGHT - ball.height dir.y=-1 end
----ETC---- --make new vars ball.x = ball.x + (dir.x * speed.x) ball.y = ball.y + (dir.y * speed.y)
--refresh screen fastCopy()
--[[-- --debug print("ball.y:" .. ball.y) print("ball.x:" .. ball.x) --]]--
end print("exiting.")
As you can see I have a basic pong game set up there. It is totally playable, just paste it into notepad or whatever, save it, and send it to your calc. If you get errors, please post them. The main reason I am posting this is because I have not come up with many ideas for different modes. The ideas I have come up with are: * Slug: Make the paddle move very slowly. I will probably make this something that happens in-game as a penalty or whatever, not as an actual game mode. * Spread: have two player paddles that move away from each other symmetrically from the center. * Obstacles: Have obstacles in the middle of the screen. * Multiple balls: self-explanatory, I think. Have more than one ball to keep track of. Please post your ideas! If you can give me tips on optimization, by all means do! I think that there may be a faster way of clearing the screen than drawing the background every frame, but I am too lazy right now to figure that out.
19
« on: August 14, 2012, 09:58:10 pm »
I installed Ubuntu 11.10 on my Dell Optiplex 745 today. I could not connect to the internet with the LiveCD, but I installed it anyway. It still doesn't work. This is the first time linux has been installed on this computer. Windows XP connects with no problem.
I have a Broadcom NetXtreme 57xx Gigabit Controller.
I have tried removing Network Manager and using dhclient but it doesn't work either.
I also tried
modprobe tg3 and then
dhclient eth0 The last command runs forever. I dont know if thats good or bad. when i do
ping google.com or try to open a page with firefox, i get a connection error.
lspci output:
flyingfisch@Office-OptiPlex-745:~$ lspci 00:00.0 Host bridge: Intel Corporation 82Q963/Q965 Memory Controller Hub (rev 02) 00:01.0 PCI bridge: Intel Corporation 82Q963/Q965 PCI Express Root Port (rev 02) 00:02.0 VGA compatible controller: Intel Corporation 82Q963/Q965 Integrated Graphics Controller (rev 02) 00:02.1 Display controller: Intel Corporation 82Q963/Q965 Integrated Graphics Controller (rev 02) 00:1a.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #4 (rev 02) 00:1a.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #5 (rev 02) 00:1a.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #2 (rev 02) 00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 02) 00:1c.0 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 1 (rev 02) 00:1c.4 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 5 (rev 02) 00:1d.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #1 (rev 02) 00:1d.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #2 (rev 02) 00:1d.2 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #3 (rev 02) 00:1d.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #1 (rev 02) 00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev f2) 00:1f.0 ISA bridge: Intel Corporation 82801HB/HR (ICH8/R) LPC Interface Controller (rev 02) 00:1f.2 IDE interface: Intel Corporation 82801H (ICH8 Family) 4 port SATA IDE Controller (rev 02) 00:1f.3 SMBus: Intel Corporation 82801H (ICH8 Family) SMBus Controller (rev 02) 00:1f.5 IDE interface: Intel Corporation 82801H (ICH8 Family) 2 port SATA IDE Controller (rev 02) 03:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5754 Gigabit Ethernet PCI Express (rev 02) EDIT2: I don't know, maybe i am not running tg3 correctly? When i run modprobe tg3, it does not run forever. It just finishes with no output. Like this:
# modprobe tg3 # _ dhclient loops forever though. Is that OK?
20
« on: July 05, 2012, 04:43:51 pm »
Just curious about how many people read ebooks on their calcs.
I read gutenberg.org ebooks on my prizm with Noteview.
21
« on: June 21, 2012, 09:54:19 pm »
Hi, My dad'slinux box crashed and he is giving it to me. He is going to get a new one,but doesnt have it yet. Anyway, I was looking around for another OS because Ubuntu is a little bloated for me, and I came across SliTaz. Its 34MB, has plenty of packages to install if you want them, and is extremely low resources. I was wondering if anyone else tried it, and what they thought of it.
22
« on: June 14, 2012, 08:58:27 pm »
OK, having a problem with PHP.
Here is the code i have:
<select name="formSelect"> <option value="value1">value1</option> <option value="value2">value2</option> </select>
<form action= "<?PHP echo "upload.php?" . $_POST["formSelect"]) ?>" method="post" enctype="multipart/form-data"> <label for="file">Filename:</label> <input type="file" name="userfile" id="file" /> <br /> <input type="submit" name="submit" value="Submit" /> </form>
And its not working.
What I want it to do is make the form action equal upload.php?formSelectvalue .
Can anyone help?
EDIT:
Fixed it by putting <select> inside the <form> tags
23
« on: June 13, 2012, 06:07:44 pm »
Dumb question I know, but anyway. How do I change the properties for a tag inside a class?
example:
<tag class="class"> <atag></atag> <tag>
To edit stuff for atag, is it
.class atag { stuff }
Or is it
atag .class { stuff }
Thanks
24
« on: June 11, 2012, 11:15:59 am »
Hi all! Working on my first game in LuaFX. So far all that happens is the ai cars try to avoid you. Code: http://pastebin.com/5EWqXNzfI am having trouble with the collisions detection right now... for some reason ai cars can "run over" you and you do not get the crash screen. The detection is done on line 231. If people could test this program that would be great, so I have provided a *.lc for download: Link
25
« on: May 15, 2012, 01:43:28 pm »
OK, just wondering if anyone else ever had this happen to them.
I had my PRIZM attached to the computer via USB and after about 10 minutes the turn off screen displayed (you know, the white one with the casio logo on it). I did not have it in receive mode. It didn't turn off, it was stuck at that screen. none of the buttons would "wake it up" so I pressed the reset button on the back. The screen went blank.
I unplugged it from the computer and tried to turn it on with AC/on. nothing. I popped all the batteries out and put them back in. nothing. I tried plugging it back into the computer and pressed the reset button. still nothing. I even tried popping the batteries while it was plugged in and replacing them and it still won't turn on.
Can anyone help me?
26
« on: February 15, 2012, 02:16:14 pm »
Is anyone thinking about porting axe to prizm?
27
« on: February 14, 2012, 07:14:11 pm »
Is anyone working on a CAS for PRIZM? Like symbolix or Jeux-Casio's CAS for fx9860?
28
« on: February 11, 2012, 09:49:20 am »
Is anyone working on a font hack for the prizm os? Or maybe even allowing users to choose their own font? I personally don't like the default font
29
« on: February 09, 2012, 04:34:01 pm »
Will we ever have an official sdk for prizm? Or are we only going to be able to use the third party ones?
30
« on: February 09, 2012, 02:56:14 pm »
Is Veb planning on porting luaFX to PRIZM?
|