Welcome Guest ( Log In | Register )

[ Big| Medium| Small] -



Post new topic Reply to topic  [ 5 posts ] 
    Jason
  Fri Jun 04, 2010 4:19 pm
User avatar
Awesome Bro

Generic Townsperson
So what I've got, is a sprite called ball with 5 subimages, and an event placed in a room.

The events sprite is set at ball, and obviously if I test play, it just sits there spasming out switching through the 5 subimages...

What I'm trying to do is make it so the event will use one of the subimages as the sprite, but I want it to select it at random, so for example, I could close and open the game a few times, and it would (Hopefully, based on chance lol...) show a different sprite subimage each time.

Does anyone have any ideas as to how I could do this? It'd be a great help and really add some variety to my levels.

Thanks, and if you need anymore info, feel free to ask.

_________________
This is a block of text that can be added to posts you make. There is a 9999 character limit.


Top Top
Profile      
 

    bacon
  Fri Jun 04, 2010 8:57 pm
butts n booties
User avatar
Staff

Party Mascot
What you might want to do is just have 5 different sprites. Then, when variable [blank] is equal to zero, the sprite changes into [sprite blank] and so on. The only issue is that I do not know how you would set a random variable. :c

I hope this is what you are asking, Im not entirely sure tbh.

you can also change the sub-image with that option as well, but I do not know if it would keep spazzing out or not.

_________________
Art Blog
Art Thread


Top Top
Profile      
 

    Jason
  Fri Jun 04, 2010 9:21 pm
User avatar
Awesome Bro

Generic Townsperson
Lol me neither, but for the time being I've got a temporary solution, although I can only use 4 sprites... I've used the Create Random action, and made 4 objects with the same parent, and different sprites.

I mean sure, it may not be convenient, but it works for now, lol...

_________________
This is a block of text that can be added to posts you make. There is a 9999 character limit.


Top Top
Profile      
 

    PrinceOfSorrow
  Thu Jul 15, 2010 4:10 am
User avatar
Member


Location: Qatar / Doha
try in "create event" for the ball with "execute code" action

Expand to see the code.


and hope it's work for you :smile:


Top Top
Profile      
 

    9robin3
  Thu Aug 26, 2010 7:54 pm
Robin Andblom
User avatar
Member

Party Mascot
You can simply do the following:

OBJECT- CREATE: Change sprite: Speed: 0 Image: random(5)

The five digit stands for your number of images in the sprite, INCLUDING the subimage 0 (zero). So you put your number of sumimages after the random text in the subimage box (loke int the exampel above!)

Another Example: I have 7 subimages and want it to randomize subimage: Change Sprite: Image: random(7).

Easy as that:)

_________________
MY PAGES:
MY HOMEPAGE
MY FB GAME PAGE
MY YOUTUBE

__________________________________________________________________________________________
GAMES IN PROGRESS:

Image

Image


Top Top
Profile      
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 


Who is online

Users browsing this forum: No users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

We are an independent, not-for-profit game making community.
Homepage
Board Index
About Us
Downloadable Games
Free Browser Games
Games in Development
RPG Maker Support
Game Maker Support
Construct 2 Support
HBGames the eZine
Advanced RPG Maker
Site Announcements
Powered by phpBB © phpBB Group