Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How to create a war game

edited November 2011 in Questions Posts: 3

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:

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
Tagged:

Comments

Sign In or Register to comment.