Better than not doing anything right?
So what is my interested?
well, i guess I like to gamble stock and forex maybe I can create some simple forex game?
whatever, just as long as I can move my lazy ass to do something
So what is the first step?
First step is the whole idea, how should my game goes?
- a graph that randomly up and down, and a few button to click buy and sell, and profit
Ok, i just need to finish my first goal
man, believe it or not, just 10 days no touch the code, I feel like a complete noob again, i spend a total of 30 minute just to get 2 button up for me to click , and below is the code, under the init i will call the create button function to create 2 button for me to click, i am lazy to draw the button, so i use the CCMenuItemFont to show the Font button
[self createbutton];
-(void)createbutton
{
// Font Item
CCMenuItem *item1 = [CCMenuItemFont itemFromString: @"LONG" target: self selector:@selector(Level1:)];
CCMenuItem *item2 = [CCMenuItemFont itemFromString: @"SHORT" target: self selector:@selector(Level1:)];
CCMenu * myMenu = [CCMenu menuWithItems:item1,item2, nil];
// Arrange the menu items vertically
[myMenu alignItemsVertically];
myMenu.position=ccp(170,140);
// add the menu to your scene
[self addChild:myMenu];
}
- (void) Level1: (CCMenuItem *) menuItem
{
NSLog(@"resume game was called");
}
And Below is the screenshot after my 30 minutes effort, OH MY GOD!!!!! so slow
ok, I cannot just stop here right, the next thing is to add a timer that will slowly increase the price or randomly change the price
- (void) myTimer:(ccTime)dt
{
smalltimer+=1;
if(smalltimer==100)
{
smalltimer=0;
NSString *temp = [NSString stringWithFormat:@"Price now is: %d", price];
[mylabel setString:temp];
price +=1;
}
}
Here I just increase the price slowly every 2 seconds increase by 1, but I took a fine 10 minute just to research how to Concat the String and Int together, there are no simple + for this
Really Addictive and stunning visuals.Play
ReplyDeleteand have fun Astonishing FREE 3D Game! PLS PROVIDE UR REVIEW NOW!