Omnimaga

Calculator Community => Casio Calculators => Topic started by: flyingfisch on June 11, 2012, 11:15:59 am

Title: [luaFX] Indy500
Post by: flyingfisch 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/5EWqXNzf (http://"http://pastebin.com/5EWqXNzf")

I 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 (http://"http://www.casio-scene.com/downloads.php?do=file&id=453")
Title: Re: [luaFX] Indy500
Post by: Nick on June 11, 2012, 12:39:49 pm
hi

i didn't test it (i don't have any casio calc), but i think i found the reason of the crash bug.
it's explained in the image (i hope you understand it xp)

(http://img.removedfromgame.com/imgs/crash.gif)

ok, i just saw a mistake in the image. the inequation signs have to be switched in the ai.x statements

in words: your ai.x value collides with the player.x value, so that's oogd
but for the y checking, you also have to iclude the height of the ai cars. in the ai.y<player.y+8 you have to change the ai.y to ai.y+ai.height <player.y+8
Title: Re: [luaFX] Indy500
Post by: Jim Bauwens on June 11, 2012, 03:28:31 pm
I should make a program to run these programs on a TI-Nspire. Shouldn't be too hard.
Title: Re: [luaFX] Indy500
Post by: flyingfisch on June 13, 2012, 10:37:35 am
hi

i didn't test it (i don't have any casio calc), but i think i found the reason of the crash bug.
it's explained in the image (i hope you understand it xp)

(http://img.removedfromgame.com/imgs/crash.gif)

ok, i just saw a mistake in the image. the inequation signs have to be switched in the ai.x statements

in words: your ai.x value collides with the player.x value, so that's oogd
but for the y checking, you also have to iclude the height of the ai cars. in the ai.y<player.y+8 you have to change the ai.y to ai.y+ai.height <player.y+8


Ah, I will try that and tell you what happens. :)