Show Posts

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.


Messages - hoffa

Pages: 1 ... 15 16 [17] 18 19 ... 22
241
Your code works with me, although I did not use a fullscreen picture (32*32).
When pushing enter only a 10*10 square is cleared.

Edit:
Also, you can expect improvement in the next OS release.
TI did not create Lua for game programming, so its not hard to understand that its not optimized for games.
Anyway, I don't have any problem with TI.Image.
Actually I tried it on the official emulator, maybe the behavior is different on the actual hardware. Once I return home I'll try it on the calculator, so hopefully that was the reason why it didn't seem to work. Thanks for clearing that up anyway.
Hopefully they will indeed improve it in the next OS!

242
well, you make drawn true when painting, so when you press enter, the drawn isn't false anymore and the sprite won't get drawn, just change that drawn=true in =false (or just delete it) and it should work

the rest of the code is correct imo
Well that was to show that it does clear the screen every time, which is absolutely dumb speed-wise (i.e. I am forced to recopy all the data to the screen no matter what).
EDIT: If only TI had made their library simple and hassle-free like SDL, it would loads better.

243
This is not the case if you only invalidate a certain spot (by giving arguments to invalidate() ).
I've made some stuff with it (smooth scrolling) and it works very good.
I'd like to see how you do that, as this simple example does clear the whole screen whenever I press the enter key:
Code: [Select]
sprite = image.new("some 318*212 ti image")
drawn = false

function on.enterKey()
    platform.window:invalidate(10, 10, 10, 10)
end

function on.paint(gc)
    if not drawn then
        gc:drawImage(sprite, 0, 0)
        drawn = true
    end
end

244
but it's really nice, why did you change the name to owl (i like it, just to know)?
I like owls and it's shorter, and somehow feels a lot less clumsy.

Looks quite nice so far. By the way although smooth scrolling cannot be implemented, have you tried 8 pixel scrolling or even 4 pixel scrolling?
No but I have tried some sort of smooth scrolling in the past. Way too slow for what it gives back, not worth the pain of implementing it. Well, at least not a this point, maybe if Lua gets a bit faster in the future, then why not.
Smooth scrolling for the character's sprite is easily possible... just a for loops over the coordinates from source to destination (maybe with actually a partial window:invalidate() to accelerate the specific screen part refresh)
But yeah, smooth scrolling for the rest (background and tiles) would indeed be slow.
My experience with partially updating the screen is that it is pointless. The thing is the TI-Nspire stupidly clears the whole screen before calling on.paint, which means I am required to "draw" (or rather, copy the stuff into some buffer) the whole screen every single time anyway. That's what takes a lot of CPU time, not the actual flipping of the screen. So, just scrolling the characters would be just as slow as scrolling the background (unless I had some blank background).

245
Looks quite nice so far. By the way although smooth scrolling cannot be implemented, have you tried 8 pixel scrolling or even 4 pixel scrolling?
No but I have tried some sort of smooth scrolling in the past. Way too slow for what it gives back, not worth the pain of implementing it. Well, at least not a this point, maybe if Lua gets a bit faster in the future, then why not.

246
It looks like his project is now named "Owl" :

https://github.com/Hoffa/Owl
It indeed is, haven't had the time to edit the thread, I'm working rather silently so I can get the most important things up. It'll also have a website and I'll use LuaDoc for the documentation.
Screenshot:
Spoiler For Spoiler:

247
Anyway joking aside, this looks nice. I will definitively have to give this a try when I have time. Will it support full screen or will it always just use a small portion of the screen due to limitations or something else?
Oh no, of course not. It's that small just to show off the scrolling (didn't bother to make a bigger map, maybe I should for the sake of a nicer demo). As I said it'll be a very flexible library, no restrictions.

EDIT: I updated the demo to a full screen one.

248
Thanks a lot! :)
BTW, is it me or is the formatting messed up?

249
I've been working on a tile engine I named Owl. I had tried it before, but it was generally quite slow and a pain in the butt to use and adapt. I tried it again, but this time a lot more seriously, and it's been progressing nicely. My goal is to make a fast (fast as in TI-Nspire Lua fast), clean, flexible and lightweight tile map engine that anyone can use. The engine currently supports arbitrary-sized maps with scrolling, easy tile, object (anything that can change state during the game), and event (detonate the nuke when Link reads that sign) management. To keep the games responsive, playable and frustration-free, scrolling and movement is blocky, i.e. no smooth scrolling or fancy walking animations (although there will be basic animation management).

As mentioned up there, graphics-heavy TI-Nspire Lua programs (read: programs that use the TI.Image format to draw images a lot) are usually rather slow. But because sprites with a lot of transparent pixels and primitive shapes can be drawn relatively quickly, to tackle the issue of slowness I decided that every tile is defined by an optional background color and and a (hopefully) partially transparent sprite that comes on top of it. That in most cases improves the speed quite a bit. Also I'm working on a map format that will increase the FPS by a good 10%—40%.

All I can give you right now is the current source code, which is kept and updated whenever I commit a change on github (I repeat, it's not ready for public use): https://github.com/Hoffa/Owl

I'll at some point write some sort of documentation and release a public version (when I feel it works and am generally pleased with it, might take some time), but until then you can play around with the code on github if you wish.

EDIT: on hold while I work on the SDL port.

250
Other Calculators / Re: Classic Pong
« on: December 06, 2011, 02:41:53 am »
Oh wow, and I can't even edit the download, it gives me an error (unwriteable directory). If possible, delete the file and I'll add it later.

251
Other Calculators / Classic Pong
« on: December 05, 2011, 09:56:45 pm »
Classic Pong



http://www.omnimaga.org/index.php?action=downloads;sa=view;down=756

This is the classic Pong game on the TI-Nspire. You can either play against a friend or against an opponent that adjusts its skill according to yours.

Controls:
1/0: move left paddle up/down
3/(-): move right paddle up/down
8: toggle game mode (i.e., one or two players)
i: invert colors
r: reset the game

252
TI-Nspire / Pong (the classic one)
« on: December 02, 2011, 02:35:51 pm »
Hey,

I wrote this Pong game so I can play it during boring classes with my buddies, nothing too fancy. You can either play against a friend or against an opponent that adjusts its skill according to yours.

Controls:
  • 1/0: move left paddle up/down
  • 3/(-): move right paddle up/down
  • 8: toggle game mode (i.e., one or two players)
  • i: invert colors
  • r: reset the game





Note: if you have the TouchPad and can't see the ball very well, play around with the brightness settings.

253
TI-Nspire / Re: [Lua] Tactical Wars CX
« on: November 11, 2011, 03:00:13 pm »
Voilà, there's 0.2 with a few fixes and stuff. I fixed many small things and added some basic things that were missing, so the changelog is really a lot of text for not that much. The better updates will come in the following versions (A* pathfinding for unit moves (and the range thing for shooting), saves, maybe some basic AI for single player, etc.).

254
TI-Nspire / Re: [Lua] Tactical Wars CX
« on: November 09, 2011, 04:47:06 pm »
Amazing game and graphics!  Hope you fix the bugs soon.  Is it possible to implement an AI  or is that kind of much?  D:
Yeah as adriweb said, making an AI for such a game is pretty hard. As mentioned in the first post, I certainly will look if I could implement at least some kind of single player that eventually uses some sort of AI. I haven't really looked into that yet; it'll come later.

255
TI-Nspire / Re: [Lua] Tactical Wars CX
« on: November 09, 2011, 02:46:18 pm »
Amazing game Hoffa! I know that the code to show where the units are able to move to must have been a nightmare. (I once tried to remake a fire emblem game and I tried to understand that part. It's what killed the project before I even started) :P
Don't tell anybody, but it actually uses a very dumb way of detecting where a unit can move or not. Actually a unit can magically jump over water and shoot through a mountain, but it rarely happens in the game as the range of the units is fairly small. I'm working on it though, there will be a real algorithm for finding the positions a unit can move to soon.

Pages: 1 ... 15 16 [17] 18 19 ... 22