• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Where can I find code for these minigame features? (fast tapping, collecting objects with cursor)

New Here ,
Feb 07, 2017 Feb 07, 2017

Copy link to clipboard

Copied

I'm building a game using Adobe Animate, and I want to have some 'minigame portions' within it. I'm planning to have some basic minigame functions listed below, but I am unable to find code for them anywhere. I often see these features in online Flash games, so I was wondering if there is anywhere I can get code for these features from:

- Tapping the spacebar as quickly as possible to fill up a bar (the bar will deplete over time).

- Using the cursor to touch moving objects to fill up a meter.

For the second feature, I'd like to know if there is a way to lock the player's cursor within the boundary of a Movieclip? I'm planning to have the game within a Movieclip, rather than using the whole Scene for it. Also, I'd like to know if there's a way for the moving objects within my MovieClip to disappear once they move past the boundary of my Movieclip. Is it possible to make my objects move using the Timer function? I thought of using the Timeline to make them move, but since I want the speed of the moving objects to change depending on the difficulty setting, and I want a 'random direction' element, I think using the Timer function would be more efficient.

Views

180

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Feb 07, 2017 Feb 07, 2017

here are some tutorials, Search results

and you can use google to search for specific snippets.

Votes

Translate

Translate
Community Expert ,
Feb 07, 2017 Feb 07, 2017

Copy link to clipboard

Copied

here are some tutorials, Search results

and you can use google to search for specific snippets.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 08, 2017 Feb 08, 2017

Copy link to clipboard

Copied

LATEST

meganl58828861 wrote:

I'm building a game using Adobe Animate, and I want to have some 'minigame portions' within it. I'm planning to have some basic minigame functions listed below, but I am unable to find code for them anywhere. I often see these features in online Flash games, so I was wondering if there is anywhere I can get code for these features from:

You're talking about stealing large chunks of code from other people's projects. What you should be doing instead is sitting down and figuring out every low-level step necessary to implement each minigame in your project. For example...

- Tapping the spacebar as quickly as possible to fill up a bar (the bar will deplete over time).

This is not a "feature" of Animate, it's a collection of features working in concert to create a system. For this interaction you will need to learn how to:

  • Render a bar with a dynamic width
  • Create a timer that fires at a specified interval and decrements the bar width
  • Fire an event based on keyboard input
  • Determine which key was pressed in the event handler
  • Create logic for the bar running out
  • Create logic for the bar filling up

These are things you can ask specific questions about. Like these...

if there is a way to lock the player's cursor within the boundary of a Movieclip?

Oh god no. Animate absolutely cannot take control of the mouse pointer. That would be a nightmare vector for malware.

Is it possible to make my objects move using the Timer function?

The Timer class is AS3 only. If you're working in a Canvas project, the underlying CreateJS library provides a global Ticker, which you can attach event listeners to. You can also run code at arbitrary intervals by using setInterval.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines