How can I implement shooting sequences?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
LJN
Newbie
Posts: 4
Joined: Sat Feb 16, 2013 1:55 pm
Contact:

How can I implement shooting sequences?

#1 Post by LJN »

I need to make a basic shooting sequence (i.e. some sort of whack-a-mole), how can I do it?

KimiYoriBaka
Miko-Class Veteran
Posts: 636
Joined: Thu May 14, 2009 8:15 pm
Projects: Castle of Arhannia
Contact:

Re: How can I implement shooting sequences?

#2 Post by KimiYoriBaka »

well, depends on the pacing and your ability to code.

it's possible to use a timer and a list of imagebuttons to make a shooting sequence, but you'd have to keep setting the timer after every click, which is somewhat awkward and can lead to lag if there's too much going on.

the other way I know of, would be to program it in pygame. this isn't too hard for someone who has used pygame, or any other gaming library before, but if you're not experienced it'll be quite a task.

User avatar
saguaro
Miko-Class Veteran
Posts: 560
Joined: Sun Feb 12, 2012 9:17 am
Completed: Locked-In, Sunrise, The Censor
Organization: Lucky Special Games
itch: saguarofoo
Location: USA
Contact:

Re: How can I implement shooting sequences?

#3 Post by saguaro »

I have a Catch the Kitten! game in YERT that might be useful to start with. The kitten imagebutton has xpos ypos that are automatically reset by a timer. It is based on an idea for a shooter by MildCurry I think.

Code: Select all

screen kitten_catch:
    $ xx = renpy.random.randint(50, 750)
    $ yy = renpy.random.randint(50, 550)
    timer 0.5 action SetScreenVariable("xx", renpy.random.randint(50, 1000)) repeat(True)
    timer 0.5 action SetScreenVariable("yy", renpy.random.randint(500, 750)) repeat(True)
    imagebutton idle kitten.pic hover kitten.pic action [Hide("kitten_catch"), Jump("kitten_got")] xanchor 0.5 xpos xx yanchor 0.5 ypos yy
    add "images/cat_fg.png"

label kitten_catch:
    scene greenbg
    play music "music/Cat Chase.ogg" fadein 0.5
    show header "Catch that kitten!" at customfade
    $ renpy.pause(2.0)
    hide header
    call screen kitten_catch
    jump kitten_got

label kitten_got:
    show header "Congratulations!" at customfade
    show message "You got a kitten!" at customfade
    jump neighborhood

LJN
Newbie
Posts: 4
Joined: Sat Feb 16, 2013 1:55 pm
Contact:

Re: How can I implement shooting sequences?

#4 Post by LJN »

How about Policenauts-style shooting sequences? Are they easier?

User avatar
kankan
Regular
Posts: 80
Joined: Tue Mar 06, 2012 1:47 am
Contact:

Re: How can I implement shooting sequences?

#5 Post by kankan »

It would be about the same, codewise anyways. It might be a little bit tougher since enemies would be firing back at you, especially if you wanted to be able to shoot down whatever they toss at you (I have to admit that I have only the barest idea on what Policenauts looks like). Are the shooting sequences essential to your game?

LJN
Newbie
Posts: 4
Joined: Sat Feb 16, 2013 1:55 pm
Contact:

Re: How can I implement shooting sequences?

#6 Post by LJN »

Yea, they are. I did try to code them by myself, but I failed. The dialog\menus system is already done, those shooting sequences are the only obstacle now, 'cause I don't have a slightest idea what should I do.

LJN
Newbie
Posts: 4
Joined: Sat Feb 16, 2013 1:55 pm
Contact:

Re: How can I implement shooting sequences?

#7 Post by LJN »

Bump - still looking for help.

Post Reply

Who is online

Users browsing this forum: Andredron