Hi all
I'm trying to make a clone of the wii game 'tanks' where it's from one to four player and the goal is to destruct the enemy tanks.... so...... i've get some of the programs in the forum and i've done something....... not the game
First
The map is made with mappy and exported with the script tolua.lua .... for the script to work, only edit the file mappy.ini and edit one of the custom lines to appear like this:
lua16=tolua.lua
then, copy the script tolua.lua to the luascr directory and reopen the mappy program
I've make the map that is in the love file.
Second
I've get some examples from here nimball, zgeigcopters and anothers and get ideas from them, the result is this frankenstein
for the moment we only can to move the tank (arrow keys) and shot with space bar....... but shot five shots every time..... i've no idea WHY aaaaaaaarg
someone can help this programmer?
sorry for my english and thank you all, without the examples here, this is not posible to make this little example
Update1: I've forget that the code to 'make' the Walls (up down right left) is'nt 'automatic' jejejee
Update2: I've see when the five shots bump 5 or 6 times.... they cross the walls and there is not more 'boing' 'boing'
Another early tanks game
Another early tanks game
- Attachments
-
- tolua.lua
- extension for mappy to export lua maps
- (6.53 KiB) Downloaded 301 times
-
- witanks.love
- Pseudo early early clone of the wii tanks
- (49.2 KiB) Downloaded 350 times
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Another early tanks game
Hi,
I tried your demo. Looks promising, although very unfinished . The bullets still behave very odd. Also: they seem to keep bouncing around. You are aware that in the Wii game, the "bullets" (shells, actually) explode on the wall after having bounced once?
Also, your English is not that hard to read. Your code would benefit from more consistent indentation, but that's a separate matter.
I tried your demo. Looks promising, although very unfinished . The bullets still behave very odd. Also: they seem to keep bouncing around. You are aware that in the Wii game, the "bullets" (shells, actually) explode on the wall after having bounced once?
Also, your English is not that hard to read. Your code would benefit from more consistent indentation, but that's a separate matter.
Help us help you: attach a .love.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Another early tanks game
I think I have an idea of why you fire five bullets, you're probably doing love.keyboard.isDown, right?
But in the time it takes for you to 'tap' your keyboard the code has already executed that five times.
So, if you move that code into keypressed or keyreleased (keypressed is recommended for responsiveness) you only fire once every time you press the button.
AFTER SOME RESEARCH IN YOUR CODE:
I didn't exactly look up why the limit is five, but I guess the rest of my assumptions are correct, I see you just stop firing once the key is released, but start with isDown. (or not with keypressed, so I assume that is isDown)
But in the time it takes for you to 'tap' your keyboard the code has already executed that five times.
So, if you move that code into keypressed or keyreleased (keypressed is recommended for responsiveness) you only fire once every time you press the button.
AFTER SOME RESEARCH IN YOUR CODE:
I didn't exactly look up why the limit is five, but I guess the rest of my assumptions are correct, I see you just stop firing once the key is released, but start with isDown. (or not with keypressed, so I assume that is isDown)
Re: Another early tanks game
looking good so far
bartbes is probably right about why you cant shoot properly, would be great to see more stuff, good luck
bartbes is probably right about why you cant shoot properly, would be great to see more stuff, good luck
Last edited by CR4SH3D on Sun May 24, 2009 11:41 am, edited 1 time in total.
http://www.gregkirk.co.nr - portfolio | http://shadowharlequin.deviantart.com - deviantart
http://www.myspace.com/shadowharlequin - myspace | http://www.vimeo.com/themilkfactory - music visuals
http://www.myspace.com/shadowharlequin - myspace | http://www.vimeo.com/themilkfactory - music visuals
Re: Another early tanks game
ok, i'm trying this but still having problems with the shots arggggggggggggggggggggggg.
Now i'v a only shot when key pressed ....... but shots are crazy...... always same angle same direction ....... same all I,m the last 3 days with this brainstorm..... for now my tank only likes to shot 45º from up to down...... only work the 'auto fire'
if space pressed a strange error appears on screen.
UPDATE1:
the super explossion over the tank is my try for make a explosion at the end of canon when a shot occurs (keypressed) ....... still not working you can see
Good luck to all coders!!!
Now i'v a only shot when key pressed ....... but shots are crazy...... always same angle same direction ....... same all I,m the last 3 days with this brainstorm..... for now my tank only likes to shot 45º from up to down...... only work the 'auto fire'
if space pressed a strange error appears on screen.
UPDATE1:
the super explossion over the tank is my try for make a explosion at the end of canon when a shot occurs (keypressed) ....... still not working you can see
Good luck to all coders!!!
- Attachments
-
- witanks_v2.love
- (54.35 KiB) Downloaded 292 times
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Another early tanks game
Well, I didn't look at the angle problem, but I do know why your shot errors, in main.lua you call player:shot(), which doesn't have a turret initialized (so tank_turret == nil, as the error says), it should be player1:shot().
Re: Another early tanks game
aaaaaaaaaaaaaaaaaaaaaaaaaarg!!!
I'm seeing this error for 3 days and haven't see aaaaaaaaaaaaaaaaaaaaaaaaaarg!!!
i dream with tanks ... with errors aaaaaaaaaaaaaaarg!!!
thank you!
I'm seeing this error for 3 days and haven't see aaaaaaaaaaaaaaaaaaaaaaaaaarg!!!
i dream with tanks ... with errors aaaaaaaaaaaaaaarg!!!
thank you!
Re: Another early tanks game
call a function with a time to spanw the explosion only once when space is pressed
as for the bullets im afraid i think theres some complex stuff you have to do with the angle of the turret and x,y coordinates, im not sure what but i vaguely remember something similar from maths
as for the bullets im afraid i think theres some complex stuff you have to do with the angle of the turret and x,y coordinates, im not sure what but i vaguely remember something similar from maths
http://www.gregkirk.co.nr - portfolio | http://shadowharlequin.deviantart.com - deviantart
http://www.myspace.com/shadowharlequin - myspace | http://www.vimeo.com/themilkfactory - music visuals
http://www.myspace.com/shadowharlequin - myspace | http://www.vimeo.com/themilkfactory - music visuals
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Another early tanks game
I haven't checked your code for this, but have you converted between degrees and radians?
Re: Another early tanks game
i dont think he would have, is there a tutorial on doing that anywhere? (not neccesarily a love specific one)
http://www.gregkirk.co.nr - portfolio | http://shadowharlequin.deviantart.com - deviantart
http://www.myspace.com/shadowharlequin - myspace | http://www.vimeo.com/themilkfactory - music visuals
http://www.myspace.com/shadowharlequin - myspace | http://www.vimeo.com/themilkfactory - music visuals
Who is online
Users browsing this forum: Google [Bot] and 1 guest