How to create a war game

Hi, I’m Mexican and codify new. and tried to create some games baces because in my pc using game maker, and basic to games there, so codify the glory to myself that the codes are very different and need some allude and thanked them, here my code and I want to move a finger to the player and another shot, thanks in advance! postscript: add new sprites to use game maker to make it One to codify! my channel on youtube 5ontrol games is to be an idea that I want to do:
http://www.youtube.com/watch?v=sJjPPrf4XT4

Code:

function setup()
    origin = vec2(0,0)
    w2 = WIDTH/2
    h2 = HEIGHT/2
end

function draw()
    background(255, 255, 255, 255)
    
    if CurrentTouch.state==BEGAN then
        sprite("Planet Cute:Star",CurrentTouch.x,CurrentTouch.y)
        sound(SOUND_SHOOT,20)
    elseif CurrentTouch.state==MOVING then
        sound(SOUND_SHOOT,20)
        sprite("Planet Cute:Star",CurrentTouch.x,CurrentTouch.y)
    end
    
    t = vec2(CurrentTouch.x-w2, CurrentTouch.y-h2)
    r = math.deg(origin:angleBetween(t))-270

    translate(w2,h2)
    rotate(r)
    
    sprite("Planet Cute:Heart")
end

--the star is the direction you should shoot and the heart is the player

:-(( hel me please :slight_smile:

Hi Kikeloop

From the video, what you want to do looks fairly simple. I’ll have a go at writing a sample for you after I finish work.

I have no doubt Simeon’s sample will be better, but here is a way to do it. http://pastebin.com/fYAYEUar

That looks pretty good, the only thing I would change is move the shoot sound() call into make_bullet() so it doesn’t continuously make a shooting sound.

What you have there is very similar to one of the first projects I did - see http://twolivesleft.com/Codea/Talk/discussion/21/spritepack-fun#Item_12 - so far as I can tell, the only real difference (other than graphics) is we picked a different origin vector. :slight_smile:

The code is here https://gist.github.com/1325166

thank you very much, that was very good :smiley:

Added my version credited to Kikeloop to wiki https://bitbucket.org/TwoLivesLeft/codea/wiki/UserContrib

You may want to add your version too Bortel’s but with a common sprite.