Omnimaga
Calculator Community => Other Calc-Related Projects and Ideas => TI-Nspire => Topic started by: Matrefeytontias on October 05, 2012, 02:52:54 am
-
Hi guys !
I'm working on my first real Ndless project in C, a port of the mobile game SpeedX 3D !
In this game, you're a ship, a man or whatever (in any case, you don't see yourself) trapped in a tunnel, and you have to run (or fly, if you're a ship ;D ) while avoiding blocks which are in the tunnel. Why are there blocks here ? Who knows ... :evillaugh:
It's the really beginning of the project, but I've already done a great part, I meant the 3D tunnel effect !
(http://mattias.refeyton.fr/espace-ti/speedx3d/3dTunnelAlone.gif)
There is still this moiré I have to remove ...
Share comments, I'll update the thread often ! ;)
For now it only works on non-CX calcs !!!
-
Hey, good luck with this. If I'm not mistaken Nick was doing a port also once. But I think it wasn't in tunnel view.
Looks nice so far.
-
Wow looks great! Is it the same game as on the iPod Touch? If so, you should make the background and circles the same color tints (blue) :D
-
As I said, for now it's only for non-CX calcs -> no colors D:
-
Dang,but LOOKIN AWSOME
-
Wow, it looks great !
I see you've resolved your problem with look-up tables :)
-
Yeah, and I can say that the tutorial I used (Ben Ryves's one) is nearly wrong :P
-
matref the z80 won already :p
no forget the axe and the hexa ;)
-
I hadn't planned so ;D
-
Nice work :thumbsup:
-
As I said, for now it's only for non-CX calcs -> no colors D:
But can't you use the function that looks like "lcd_ingray" (I don't code in C for Nspire so I don't know the exact formulation of the fucntion :P) to make it work on both calcs ?
In fact I don't even know what that command would do but I feel like this would work :P
-
Oh yeah, I didn't think of it :D I'll use it.
-
The name of this program is very similar to Nick's program, but I guess it's a different game. It does look really nice right now! Keep up the good work!
-
Are you drawing 1 corner and then mirroring?
-
Nope, I'm drawing the whole scene with
for(y = 0; y < 240; y += 2)
{
for(x = 0; x < 240; x += 2)
{
...
setPixelBuf(screen, x+40, y, color);
setPixelBuf(screen, x+41, y, color);
setPixelBuf(screen, x+40, y+1, color);
setPixelBuf(screen, x+41, y+1, color);
}
}
@cyanophycean314 in fact it's the same game, but in Lua and because of the huge amount of calculations Nick choosed to make it plane when in C I choosed to make it a tunnel :)
-
hmmm, i should try porting this to LuaFX and LuaZM...
-
It'll be very hard in fact :/ I first did it in Lua, in a proof of concept, and it ran at 0.125 FPS ^^'
-
How does your 3D routine work?
I thought I would do it like this:
1. draw lines.
2. draw circles.
3. draw obstacles.
4. collision detection
I would not be making it really 3D, it would be pseudo 3D.
-
It's pseudo-3D based on angles and depths. I followed this tutorial by Ben Ryves (http://www.benryves.com/tutorials/tunnel/), but it appears that several concepts are wrongs (like the calculation of the depth, he use a really weird way to do this and I had a hard time to make it work).
You can of course ask questions if you're in trouble :)
-
As I said, for now it's only for non-CX calcs -> no colors D:
Are you planning CX support in the near future, though? Because non-CX calcs are getting harder and harder to find in stores so your game would probably get fewer and fewer interest with the time. D:
-
Yeah, of course I planned to adapt it for CX calcs ;) I even planned to make it with colors.
-
Looking great! :D
-
Small update :)
In fact I just moved the origin up to make the player run on the ground instead of fly at the middle of the tunnel. And I also changed the texture so it looks better on-calc, even if it's worse on an emulator.
(http://mattias.refeyton.fr/espace-ti/speedx3d/3dTunnelAloneShifted.gif)
Also, the screen is taken by a Ti-Nspire CX CAS emulator :D
-
Up !
I'm having trouble with srand() ... If I try to use it, the program crashes without saying anything. Here is the way I use it :int ... , *initRand = 0x90090000; // IRQ timer location
// mallocs here
srand(*initRand);
I think that the program crashes here.
Idea anyone ?
-
This syscall doesn't work in the current ndless revision also for other people :-\ You might have to implement a random number function yourself.
-
That's weird, I've already done a program using this func and it worked perfectly (but maybe it's thanks to nSDL ...).
-
It works on cx, but not on classic nspires.
-
SpeedX doesn't work on anything, and my others works on both ???
-
Then just implement your own rand function, for example
static unsigned x;
void sxorrand(unsigned seed){
x = seed;
}
unsigned xorrand() {
x ^= x << 13;
x ^= x >> 17;
x ^= x << 5;
return x;
}
-
Yeah, good idea, I'll use it. Thanks a lot :)
-
As for other random generator types, a LFSR with significant length (32 bits), initialized with significant entropy (preferably > 10 bits), can yield good enough results without requiring division / modulo.
Several demos made by Thomas Nussbaumer for the TI-68k series, which I ported to the Nspire, use a LFSR written in C. My 127-byte "TV noise" demo, in 68000 ASM, also uses a LFSR for size constraints.
-
Update !
I added obstacles :thumbsup: well, for now they're inconsistents, but they're here ! ;D
(http://mattias.refeyton.fr/espace-ti/speedx3d/inconsistentsObstacles.gif)
(credits to lkj for the xorrand function)
-
How do you lose? I watched the screenie, and noticed that nothing happened even when the obstacles are in the middle :P
-
How do you lose?
Losing The Game is IMPOSSIBLE?? O.O
Just kidding this looks kinda nice. Do you think in the grayscale version you can eventually add multiple shades of gray so it's no longer monochrome or would that hurt speed too much?
-
@AzNg0d1030 I just pressed ESC :P
@DJ_O I'll do that after removing the moiré, or you'll see an ugly grey curve coming to you from the center of the screen. And it doesn't hurt speed at all since grey are fully supported by the LCD.
-
@AzNg0d1030 I just pressed ESC :P
@DJ_O I'll do that after removing the moiré, or you'll see an ugly grey curve coming to you from the center of the screen. And it doesn't hurt speed at all since grey are fully supported by the LCD.
Ah so it isn't implemented yet? (Losing by hitting something)
-
What is a moiré? ???
-
@AzNg0d1030 not yet, but it's my next goal on my list ;)
@DJ_O a moiré is the ugly thing at the center of the screen, if you look well you'll see a cloud of dots which looks like nothing :P
-
Maybe I should point out that there is a mistake in the topic title. it should be reaches and not reach if I'm not mistaken.
Also, looking good.
-
Oh my, you're right :P
/me the Frenchie riche iur enspirre
-
Looks good! Great progress! ;)
-
Aaaw, look at this great update ! :D
I added consistent obstacles, 86 patterns for the blocks to spawn, and working collision detection !
(http://mattias.refeyton.fr/espace-ti/speedx3d/fullyImplementedObstacles.gif)
Now, it's fully playable and I've done the gameplay !
Here's what I planned to do :- Bonus and malus : they'll be parts of the tunnel filled with different colours corresponding to different (bon|mal) uses
- 4 difficulty levels (Newbie, Easy, Hard and Hardcore, corresponding to different speeds)
You can of course propose things :)
-
What do you mean by "working collision detection"? I still don't die if I fall into an obstacle?
Also is it intended that the obstacles sometimes change their places when they're about five segments in front of you?
A highscore system would be cool :)
-
What do you mean by "working collision detection"? I still don't die if I fall into an obstacle?
Also is it intended that the obstacles sometimes change their places when they're about five segments in front of you?
A highscore system would be cool :)
That's probably a bug. I guess you are supposed to lose when you hit an obstacle at the bottom of the screen :\
-
@AzNg0d1030 That's not it ; in fact due to the way I display the obstacles they appear two times : one at a normal distance and one far away. So when the place of the obstacles you just avoided change, the place of the buggy obstacles changes too, even if they are far away. It'll be resolved when I'll remove the moiré.
@lkj no, I meant "collision detection works now" :P
And yeah, I planned highscore, I just forgot to write it ;D
-
@AzNg0d1030 That's not it ; in fact due to the way I display the obstacles they appear two times : one at a normal distance and one far away. So when the place of the obstacles you just avoided change, the place of the buggy obstacles changes too, even if they are far away. It'll be resolved when I'll remove the moiré.
@lkj no, I meant "collision detection works now" :P
And yeah, I planned highscore, I just forgot to write it ;D
o.o got it understand now
-
Looks very great. Does it get more and more challenging as the game progress?
-
Nope, I won't do that. In fact, what I planned is making 4 different levels, which are 4 different speeds.
-
Nope, I won't do that. In fact, what I planned is making 4 different levels, which are 4 different speeds.
That sounds great!
-
Über-super-hyper-giga-necro post of hell of death of darkness :w00t:
After one year, I finally decided to resume this. Since I currently have no real project for Nspire (nRayC isn't a "real" project), I decided to take this out of the garage and work back on it.
For now, the only thing I did was to port it to nSDL (which makes work with pixels faster and cross-platform), speed up the game a bit and shrink the space between obstacles (so now it's actually a bit challenging :P).
Also, I'm lacking ideas to make the game interesting (let's be honest, it's not very funny atm). I want to add bonuses in form of different textures for the tunnel (for example, a yellow sector will give you a shield which will permit you to take one damage before dying) and penalties in form of sectors you can't avoid (for example, your vision will be shrink).
By "sector", I mean the lines you fly on, that goes forward. Not sure if you get it, but the tunnel is divided in 8 sectors, on which there can be an obstacle, a bonus or just nothing.
-
Add some nice visuals, like earthquake, or color palette swap (change palette), trippy visuals for a real psychedelic experience!
-
Now that I think of it, this game is based on SpeedX3D for Android and iOS, so I'll try to include as much elements of the original game as possible in the port before starting anything else :P
-
Looks very nice, but some suggestions: Add color and maybe make the sprites more detailed (like in Spenceboy98's Tunnel), and make the tunnel so that obstacles won't appear right in your face when the game starts, so you won't keep dying in less than a second.
Also make it so the obstacles won't constantly changes position, because it's pretty random and you never know how to avoid them. Maybe make them so half a second before changing position, their new position is displayed in red or something, to warn you in advance.